Bug 335270 r=ben Make subscriptions item have a favicon, fix importer icon bugs.
git-svn-id: svn://10.0.0.236/trunk@195268 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
f4b574fe50
commit
aafe753135
@ -878,11 +878,6 @@ BookmarkContentSink::SetFaviconForURI(nsIURI* aPageURI, nsIURI* aIconURI,
|
||||
nsresult rv;
|
||||
static PRUint32 serialNumber = 0; // for made-up favicon URIs
|
||||
|
||||
// some bookmarks have placeholder URIs that contain just "data:"
|
||||
// ignore these
|
||||
if (aData.Length() <= 5)
|
||||
return NS_OK;
|
||||
|
||||
nsFaviconService* faviconService = nsFaviconService::GetFaviconService();
|
||||
if (! faviconService)
|
||||
return NS_ERROR_NO_INTERFACE;
|
||||
@ -891,11 +886,17 @@ BookmarkContentSink::SetFaviconForURI(nsIURI* aPageURI, nsIURI* aIconURI,
|
||||
// worry about data
|
||||
if (aIconURI) {
|
||||
nsCString faviconScheme;
|
||||
aIconURI->GetScheme(faviconScheme);
|
||||
if (faviconScheme.EqualsLiteral("chrome")) {
|
||||
return faviconService->SetFaviconUrlForPage(aPageURI, aIconURI);
|
||||
}
|
||||
}
|
||||
|
||||
// some bookmarks have placeholder URIs that contain just "data:"
|
||||
// ignore these
|
||||
if (aData.Length() <= 5)
|
||||
return NS_OK;
|
||||
|
||||
nsCOMPtr<nsIURI> faviconURI;
|
||||
if (aIconURI) {
|
||||
faviconURI = aIconURI;
|
||||
|
||||
@ -1626,8 +1626,24 @@ nsNavHistoryQueryResultNode::nsNavHistoryQueryResultNode(
|
||||
&mHasSearchTerms);
|
||||
|
||||
// queries have special icons if not otherwise set
|
||||
if (mFaviconURI.IsEmpty())
|
||||
if (mFaviconURI.IsEmpty()) {
|
||||
mFaviconURI.AppendLiteral(ICONURI_QUERY);
|
||||
|
||||
// see if there's a favicon explicitly set on this query
|
||||
nsFaviconService* faviconService = nsFaviconService::GetFaviconService();
|
||||
if (! faviconService)
|
||||
return;
|
||||
nsresult rv = VerifyQueriesSerialized();
|
||||
if (NS_FAILED(rv)) return;
|
||||
|
||||
nsCOMPtr<nsIURI> queryURI;
|
||||
rv = NS_NewURI(getter_AddRefs(queryURI), mURI);
|
||||
if (NS_FAILED(rv)) return;
|
||||
nsCOMPtr<nsIURI> favicon;
|
||||
rv = faviconService->GetFaviconForPage(queryURI, getter_AddRefs(favicon));
|
||||
if (NS_FAILED(rv)) return;
|
||||
favicon->GetSpec(mFaviconURI);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -16,6 +16,6 @@
|
||||
<DD>Add bookmarks to this folder to see them displayed on the Bookmarks Toolbar
|
||||
<DL><p>
|
||||
</DL><p>
|
||||
<DT><A HREF="place:&annotation=livemark%2FfeedURI">Subscriptions</A>
|
||||
<DT><A HREF="place:&annotation=livemark%2FfeedURI" ICON_URI="chrome://browser/skin/places/livemarkItem.png">Subscriptions</A>
|
||||
<DD>Shows all Subscribed Feeds
|
||||
</DL><p>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user