Bug 525708 - mIconURL shouldn't need to be accessed outside of tabbrowser.xml. r=mano
This commit is contained in:
Родитель
181b693ec6
Коммит
3e6919d49d
|
@ -2292,7 +2292,7 @@ function SetPageProxyState(aState)
|
|||
gLastValidURLStr = gURLBar.value;
|
||||
gURLBar.addEventListener("input", UpdatePageProxyState, false);
|
||||
|
||||
PageProxySetIcon(gBrowser.selectedBrowser.mIconURL);
|
||||
PageProxySetIcon(gBrowser.getIcon());
|
||||
} else if (aState == "invalid") {
|
||||
gURLBar.removeEventListener("input", UpdatePageProxyState, false);
|
||||
PageProxyClearIcon();
|
||||
|
@ -3913,9 +3913,9 @@ var XULBrowserWindow = {
|
|||
}
|
||||
},
|
||||
|
||||
onLinkIconAvailable: function (aBrowser) {
|
||||
onLinkIconAvailable: function (aBrowser, aIconURL) {
|
||||
if (gProxyFavIcon && gBrowser.userTypedValue === null)
|
||||
PageProxySetIcon(aBrowser.mIconURL); // update the favicon in the URL bar
|
||||
PageProxySetIcon(aIconURL); // update the favicon in the URL bar
|
||||
},
|
||||
|
||||
onProgressChange: function (aWebProgress, aRequest,
|
||||
|
@ -3980,7 +3980,7 @@ var XULBrowserWindow = {
|
|||
if (aWebProgress.DOMWindow == content) {
|
||||
if (aRequest)
|
||||
this.endDocumentLoad(aRequest, aStatus);
|
||||
if (!gBrowser.mTabbedMode && !gBrowser.selectedBrowser.mIconURL)
|
||||
if (!gBrowser.mTabbedMode && !gBrowser.getIcon())
|
||||
gBrowser.useDefaultIcon(gBrowser.selectedTab);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -700,7 +700,7 @@
|
|||
let p = this.mProgressListeners[i];
|
||||
if ('onLinkIconAvailable' in p)
|
||||
try {
|
||||
p.onLinkIconAvailable(browser);
|
||||
p.onLinkIconAvailable(browser, browser.mIconURL);
|
||||
} catch (e) {
|
||||
// don't inhibit other listeners
|
||||
Components.utils.reportError(e);
|
||||
|
@ -712,7 +712,7 @@
|
|||
let p = this.mTabsProgressListeners[i];
|
||||
if ('onLinkIconAvailable' in p)
|
||||
try {
|
||||
p.onLinkIconAvailable(browser);
|
||||
p.onLinkIconAvailable(browser, browser.mIconURL);
|
||||
} catch (e) {
|
||||
// don't inhibit other listeners
|
||||
Components.utils.reportError(e);
|
||||
|
@ -722,6 +722,16 @@
|
|||
</body>
|
||||
</method>
|
||||
|
||||
<method name="getIcon">
|
||||
<parameter name="aTab"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
let browser = aTab ? this.getBrowserForTab(aTab) : this.selectedBrowser;
|
||||
return browser.mIconURL;
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
<method name="updateIcon">
|
||||
<parameter name="aTab"/>
|
||||
<body>
|
||||
|
|
|
@ -76,7 +76,7 @@ function test() {
|
|||
}
|
||||
|
||||
is(newWindow.gBrowser.selectedTab.hasAttribute("busy"), true);
|
||||
is(newWindow.gBrowser.selectedTab.linkedBrowser.mIconURL,iconURLSpec);
|
||||
is(newWindow.gBrowser.getIcon(), iconURLSpec);
|
||||
newWindow.close();
|
||||
finish();
|
||||
}
|
||||
|
|
|
@ -102,7 +102,6 @@ function test() {
|
|||
onSecurityChange: function() {},
|
||||
onStatusChange: function() {},
|
||||
onRefreshAttempted: function() {},
|
||||
onLinkIconAvailable: function() {},
|
||||
onStateChange: function(aBrowser, aWebProgress, aRequest, aStateFlags, aStatus) {
|
||||
if (aStateFlags & (Ci.nsIWebProgressListener.STATE_STOP |
|
||||
Ci.nsIWebProgressListener.STATE_IS_WINDOW)) {
|
||||
|
|
|
@ -517,9 +517,9 @@ TabWindow.prototype = {
|
|||
},
|
||||
onStatusChange: function () {
|
||||
},
|
||||
onLinkIconAvailable: function (aBrowser) {
|
||||
onLinkIconAvailable: function (aBrowser, aIconURL) {
|
||||
let self = this;
|
||||
getFaviconAsImage(aBrowser.mIconURL, function (img) {
|
||||
getFaviconAsImage(aIconURL, function (img) {
|
||||
let index = self.tabbrowser.browsers.indexOf(aBrowser);
|
||||
// Only add it if we've found the index. The tab could have closed!
|
||||
if (index != -1)
|
||||
|
|
|
@ -68,7 +68,6 @@ var reporterListener = {
|
|||
onProgressChange: function() { },
|
||||
onStatusChange: function() { },
|
||||
onSecurityChange: function() { },
|
||||
onLinkIconAvailable: function() { },
|
||||
onProgressChange64: function() { },
|
||||
onRefreshAttempted: function() { return true; }
|
||||
}
|
||||
|
|
|
@ -290,7 +290,6 @@ var gViewSourceUtils = {
|
|||
onProgressChange: function() {return 0;},
|
||||
onStatusChange: function() {return 0;},
|
||||
onSecurityChange: function() {return 0;},
|
||||
onLinkIconAvailable: function() {return 0;},
|
||||
|
||||
webShell: null,
|
||||
editor: null,
|
||||
|
|
|
@ -220,7 +220,6 @@ function submitForm(iframe, dump, extra, link)
|
|||
onProgressChange: function() {return 0;},
|
||||
onStatusChange: function() {return 0;},
|
||||
onSecurityChange: function() {return 0;},
|
||||
onLinkIconAvailable: function() {return 0;}
|
||||
};
|
||||
iframe.docShell.QueryInterface(Ci.nsIWebProgress);
|
||||
iframe.docShell.addProgressListener(myListener, Ci.nsIWebProgress.NOTIFY_STATE_DOCUMENT);
|
||||
|
|
Загрузка…
Ссылка в новой задаче