зеркало из https://github.com/mozilla/pjs.git
Add "IsBookmarked" method.
This commit is contained in:
Родитель
f17e2b0991
Коммит
165e8f083d
|
@ -32,6 +32,7 @@
|
|||
interface nsIBookmarksService : nsISupports
|
||||
{
|
||||
void ReadBookmarks();
|
||||
boolean IsBookmarked(in string aURI);
|
||||
void AddBookmark(in string aURI, in wstring aTitle);
|
||||
void UpdateBookmarkLastVisitedDate(in string aURL);
|
||||
string FindShortcut(in wstring aName);
|
||||
|
|
|
@ -2673,6 +2673,27 @@ nsBookmarksService::AddBookmark(const char *aURI, const PRUnichar *aOptionalTitl
|
|||
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBookmarksService::IsBookmarked(const char *aURI, PRBool *isBookmarkedFlag)
|
||||
{
|
||||
if (!aURI) return(NS_ERROR_UNEXPECTED);
|
||||
if (!isBookmarkedFlag) return(NS_ERROR_UNEXPECTED);
|
||||
if (!mInner) return(NS_ERROR_UNEXPECTED);
|
||||
|
||||
*isBookmarkedFlag = PR_FALSE;
|
||||
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIRDFResource> bookmark;
|
||||
if (NS_SUCCEEDED(rv = gRDF->GetResource(aURI, getter_AddRefs(bookmark))))
|
||||
{
|
||||
rv = mInner->HasAssertion(bookmark, kRDF_type, kNC_Bookmark,
|
||||
PR_TRUE, isBookmarkedFlag);
|
||||
}
|
||||
return(rv);
|
||||
}
|
||||
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBookmarksService::UpdateBookmarkLastVisitedDate(const char *aURL)
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче