Checkin for bug 182366. r=heikki. sr=hewitt. a=asa. Start of project to use machine learning to better order results shown in the autocomplete dropdown.
git-svn-id: svn://10.0.0.236/trunk@235826 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -80,6 +80,15 @@ interface nsIBookmarksService : nsISupports
|
||||
wstring getLastCharset(in string aURI);
|
||||
|
||||
void importSystemBookmarks(in nsIRDFResource aParentFolder);
|
||||
|
||||
/**
|
||||
* Get the time when a bookmark was added
|
||||
*
|
||||
* @param aBookmarkURL The url of the bookmark
|
||||
* @param aAddTime The time when aBookmarkURL was added to the bookmarks.
|
||||
*
|
||||
*/
|
||||
void getAddTime(in string aBookmarkURL, out long long aAddTime);
|
||||
};
|
||||
|
||||
%{C++
|
||||
|
||||
@@ -3030,6 +3030,37 @@ nsBookmarksService::RemoveBookmarkIcon(const char *aURL, const PRUnichar *iconUR
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBookmarksService::GetAddTime(const char *aBookmarkURL, PRInt64* aAddTime)
|
||||
{
|
||||
nsCOMPtr<nsIRDFResource> bookmark;
|
||||
nsresult rv;
|
||||
|
||||
if (NS_SUCCEEDED(rv = gRDF->GetResource(aBookmarkURL, getter_AddRefs(bookmark) )))
|
||||
{
|
||||
// Note: always use mInner!! Otherwise, could get into an infinite loop
|
||||
// due to Assert/Change calling UpdateBookmarkLastModifiedDate()
|
||||
|
||||
nsCOMPtr<nsIRDFNode> nodeType;
|
||||
GetSynthesizedType(bookmark, getter_AddRefs(nodeType));
|
||||
if (nodeType == kNC_Bookmark)
|
||||
{
|
||||
nsCOMPtr<nsIRDFNode> node;
|
||||
rv = mInner->GetTarget(bookmark, kNC_BookmarkAddDate, PR_TRUE,
|
||||
getter_AddRefs(node));
|
||||
if (rv != NS_RDF_NO_VALUE)
|
||||
{
|
||||
nsCOMPtr<nsIRDFDate> addDate = do_QueryInterface(node);
|
||||
if (addDate)
|
||||
{
|
||||
rv = addDate->GetValue(aAddTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBookmarksService::UpdateLastVisitedDate(const char *aURL, const PRUnichar *aCharset)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user