Bug 1186077 - Default favicon (globe) is briefly shown on about:home before updating to favicon. r=mcomella

--HG--
extra : commitid : G4BFIQ4TjMM
This commit is contained in:
Sergej Kravcenko 2015-09-15 17:28:37 -07:00
parent 1bca3c2ed3
commit 52b391375c
2 changed files with 12 additions and 3 deletions

View File

@ -424,6 +424,11 @@ public class Tab {
}
public void loadFavicon() {
// Static Favicons never change
if (AboutPages.isBuiltinIconPage(mUrl) && mFavicon != null) {
return;
}
// If we have a Favicon explicitly set, load it.
if (!mAvailableFavicons.isEmpty()) {
RemoteFavicon newFavicon = mAvailableFavicons.first();
@ -667,6 +672,12 @@ public class Tab {
// spurious location change, so we're definitely loading a new
// page.
clearFavicon();
// Load local static Favicons immediately
if (AboutPages.isBuiltinIconPage(uri)) {
loadFavicon();
}
updateTitle(null);
}
}

View File

@ -924,10 +924,8 @@ public class Tabs implements GeckoEventListener {
selectTab(tabToSelect.getId());
}
// TODO: surely we could just fetch *any* cached icon?
// Load favicon instantly for about:home page because it's already cached
if (AboutPages.isBuiltinIconPage(url)) {
Log.d(LOGTAG, "Setting about: tab favicon inline.");
tabToSelect.addFavicon(url, Favicons.browserToolbarFaviconSize, "");
tabToSelect.loadFavicon();
}