Bug 597673 - Kill updateIcon. r=gavin

This commit is contained in:
Dão Gottwald 2010-09-24 09:29:50 +02:00
Родитель e14ca98532
Коммит 4231d61d06
3 изменённых файлов: 22 добавлений и 37 удалений

Просмотреть файл

@ -434,7 +434,6 @@
this.mTab.setAttribute("busy", "true"); this.mTab.setAttribute("busy", "true");
this.mTab.setAttribute("progresspercent", "0"); this.mTab.setAttribute("progresspercent", "0");
this._startStalledTimer(); this._startStalledTimer();
this.mTabBrowser.updateIcon(this.mTab);
this.mTabBrowser.setTabTitleLoading(this.mTab); this.mTabBrowser.setTabTitleLoading(this.mTab);
} }
@ -463,7 +462,6 @@
this.mTab.removeAttribute("progresspercent"); this.mTab.removeAttribute("progresspercent");
this.mTab.removeAttribute("stalled"); this.mTab.removeAttribute("stalled");
this._cancelStalledTimer(); this._cancelStalledTimer();
this.mTabBrowser.updateIcon(this.mTab);
var location = aRequest.QueryInterface(nsIChannel).URI; var location = aRequest.QueryInterface(nsIChannel).URI;
@ -602,7 +600,13 @@
aURI, false); aURI, false);
} }
this.updateIcon(aTab); if ((browser.mIconURL || "") != aTab.getAttribute("image")) {
if (browser.mIconURL)
aTab.setAttribute("image", browser.mIconURL);
else
aTab.removeAttribute("image");
this._tabAttrModified(aTab);
}
this._callProgressListeners(browser, "onLinkIconAvailable", [browser.mIconURL]); this._callProgressListeners(browser, "onLinkIconAvailable", [browser.mIconURL]);
]]> ]]>
@ -619,20 +623,6 @@
</body> </body>
</method> </method>
<method name="updateIcon">
<parameter name="aTab"/>
<body>
<![CDATA[
var browser = this.getBrowserForTab(aTab);
if (!aTab.hasAttribute("busy") && browser.mIconURL)
aTab.setAttribute("image", browser.mIconURL);
else
aTab.removeAttribute("image");
this._tabAttrModified(aTab);
]]>
</body>
</method>
<method name="shouldLoadFavIcon"> <method name="shouldLoadFavIcon">
<parameter name="aURI"/> <parameter name="aURI"/>
<body> <body>
@ -650,31 +640,29 @@
<body> <body>
<![CDATA[ <![CDATA[
var browser = this.getBrowserForTab(aTab); var browser = this.getBrowserForTab(aTab);
var docURIObject = browser.contentDocument.documentURIObject; var docURIObject = browser.contentDocument.documentURIObject;
var icon = null;
if (browser.contentDocument instanceof ImageDocument) { if (browser.contentDocument instanceof ImageDocument) {
if (Services.prefs.getBoolPref("browser.chrome.site_icons")) { if (Services.prefs.getBoolPref("browser.chrome.site_icons")) {
let sz = Services.prefs.getIntPref("browser.chrome.image_icons.max_size");
try { try {
let sz = Services.prefs.getIntPref("browser.chrome.image_icons.max_size"); let req = browser.contentDocument.imageRequest;
if (!sz) if (req &&
return; req.image &&
req.image.width <= sz &&
var req = browser.contentDocument.imageRequest; req.image.height <= sz)
if (!req || !req.image || icon = browser.currentURI;
req.image.width > sz ||
req.image.height > sz)
return;
this.setIcon(aTab, browser.currentURI);
} catch (e) { } } catch (e) { }
} }
} }
// Use documentURIObject in the check for shouldLoadFavIcon so that we // Use documentURIObject in the check for shouldLoadFavIcon so that we
// do the right thing with about:-style error pages. Bug 453442 // do the right thing with about:-style error pages. Bug 453442
else if (this.shouldLoadFavIcon(docURIObject)) { else if (this.shouldLoadFavIcon(docURIObject)) {
var url = docURIObject.prePath + "/favicon.ico"; let url = docURIObject.prePath + "/favicon.ico";
if (!this.isFailedIcon(url)) if (!this.isFailedIcon(url))
this.setIcon(aTab, url); icon = url;
} }
this.setIcon(aTab, icon);
]]> ]]>
</body> </body>
</method> </method>
@ -974,7 +962,6 @@
this.mCurrentTab.setAttribute("busy", "true"); this.mCurrentTab.setAttribute("busy", "true");
this.mIsBusy = true; this.mIsBusy = true;
this.setTabTitleLoading(this.mCurrentTab); this.setTabTitleLoading(this.mCurrentTab);
this.updateIcon(this.mCurrentTab);
} else { } else {
this.setIcon(this.mCurrentTab, this.mCurrentBrowser.mIconURL); this.setIcon(this.mCurrentTab, this.mCurrentBrowser.mIconURL);
} }
@ -1725,7 +1712,6 @@
this.setTabTitleLoading(aOurTab); this.setTabTitleLoading(aOurTab);
else else
this.setTabTitle(aOurTab); this.setTabTitle(aOurTab);
this.updateIcon(aOurTab);
// If the tab was already selected (this happpens in the scenario // If the tab was already selected (this happpens in the scenario
// of replaceTabWithWindow), notify onLocationChange, etc. // of replaceTabWithWindow), notify onLocationChange, etc.

Просмотреть файл

@ -39,8 +39,9 @@ var progressListener = {
if (aBrowser == tab.linkedBrowser) if (aBrowser == tab.linkedBrowser)
record(arguments.callee.name); record(arguments.callee.name);
}, },
onLinkIconAvailable: function onLinkIconAvailable(aBrowser) { onLinkIconAvailable: function onLinkIconAvailable(aBrowser, aIconURL) {
if (aBrowser == tab.linkedBrowser) if (aBrowser == tab.linkedBrowser &&
aIconURL == "about:logo")
record(arguments.callee.name); record(arguments.callee.name);
} }
}; };

Просмотреть файл

@ -2371,8 +2371,6 @@ SessionStoreService.prototype = {
browser.stop(); // in case about:blank isn't done yet browser.stop(); // in case about:blank isn't done yet
tabbrowser.updateIcon(tab);
// wall-paper fix for bug 439675: make sure that the URL to be loaded // wall-paper fix for bug 439675: make sure that the URL to be loaded
// is always visible in the address bar // is always visible in the address bar
let activeIndex = (tabData.index || tabData.entries.length) - 1; let activeIndex = (tabData.index || tabData.entries.length) - 1;