diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 9c902c66b665..fae3a2801056 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -1111,6 +1111,7 @@ function prepareForStartup() { // hook up UI through progress listener gBrowser.addProgressListener(window.XULBrowserWindow, Components.interfaces.nsIWebProgress.NOTIFY_ALL); + gBrowser.addTabsProgressListener(window.TabsProgressListener); // setup our common DOMLinkAdded listener gBrowser.addEventListener("DOMLinkAdded", DOMLinkHandler, false); @@ -1339,6 +1340,7 @@ function BrowserShutdown() try { gBrowser.removeProgressListener(window.XULBrowserWindow); + gBrowser.removeTabsProgressListener(window.TabsProgressListener); } catch (ex) { } @@ -3796,8 +3798,7 @@ var XULBrowserWindow = { }, onLinkIconAvailable: function (aBrowser) { - if (gProxyFavIcon && gBrowser.mCurrentBrowser == aBrowser && - gBrowser.userTypedValue === null) + if (gProxyFavIcon && gBrowser.userTypedValue === null) PageProxySetIcon(aBrowser.mIconURL); // update the favicon in the URL bar }, @@ -3858,8 +3859,6 @@ var XULBrowserWindow = { if (aWebProgress.DOMWindow == content) { if (aRequest) this.endDocumentLoad(aRequest, aStatus); - if (!gBrowser.mTabbedMode && !gBrowser.mCurrentBrowser.mIconURL) - gBrowser.useDefaultIcon(gBrowser.mCurrentTab); if (Components.isSuccessCode(aStatus) && content.document.documentElement.getAttribute("manifest")) @@ -3996,9 +3995,6 @@ var XULBrowserWindow = { this.reloadCommand.removeAttribute("disabled"); } - if (!gBrowser.mTabbedMode && aWebProgress.isLoadingDocument) - gBrowser.setIcon(gBrowser.mCurrentTab, null); - if (gURLBar) { // Strip off "wyciwyg://" and passwords for the location bar let uri = aLocationURI; @@ -4044,55 +4040,6 @@ var XULBrowserWindow = { this.updateStatusField(); }, - onRefreshAttempted: function (aWebProgress, aURI, aDelay, aSameURI) { - if (gPrefService.getBoolPref("accessibility.blockautorefresh")) { - let brandBundle = document.getElementById("bundle_brand"); - let brandShortName = brandBundle.getString("brandShortName"); - let refreshButtonText = - gNavigatorBundle.getString("refreshBlocked.goButton"); - let refreshButtonAccesskey = - gNavigatorBundle.getString("refreshBlocked.goButton.accesskey"); - let message = - gNavigatorBundle.getFormattedString(aSameURI ? "refreshBlocked.refreshLabel" - : "refreshBlocked.redirectLabel", - [brandShortName]); - let topBrowser = getBrowserFromContentWindow(aWebProgress.DOMWindow.top); - let docShell = aWebProgress.DOMWindow - .QueryInterface(Ci.nsIInterfaceRequestor) - .getInterface(Ci.nsIWebNavigation) - .QueryInterface(Ci.nsIDocShell); - let notificationBox = gBrowser.getNotificationBox(topBrowser); - let notification = notificationBox.getNotificationWithValue("refresh-blocked"); - if (notification) { - notification.label = message; - notification.refreshURI = aURI; - notification.delay = aDelay; - notification.docShell = docShell; - } else { - let buttons = [{ - label: refreshButtonText, - accessKey: refreshButtonAccesskey, - callback: function (aNotification, aButton) { - var refreshURI = aNotification.docShell - .QueryInterface(Ci.nsIRefreshURI); - refreshURI.forceRefreshURI(aNotification.refreshURI, - aNotification.delay, true); - } - }]; - notification = - notificationBox.appendNotification(message, "refresh-blocked", - "chrome://browser/skin/Info.png", - notificationBox.PRIORITY_INFO_MEDIUM, - buttons); - notification.refreshURI = aURI; - notification.delay = aDelay; - notification.docShell = docShell; - } - return false; - } - return true; - }, - // Properties used to cache security state used to update the UI _state: null, _host: undefined, @@ -4159,9 +4106,15 @@ var XULBrowserWindow = { if (level) { this.securityButton.setAttribute("level", level); this.securityButton.hidden = false; + // We don't style the Location Bar based on the the 'level' attribute + // anymore, but still set it for third-party themes. + if (gURLBar) + gURLBar.setAttribute("level", level); } else { this.securityButton.hidden = true; this.securityButton.removeAttribute("level"); + if (gURLBar) + gURLBar.removeAttribute("level"); } if (setHost && this._host) @@ -4244,6 +4197,73 @@ var XULBrowserWindow = { } } +var TabsProgressListener = { + onProgressChange: function (aBrowser, aWebProgress, aRequest, + aCurSelfProgress, aMaxSelfProgress, + aCurTotalProgress, aMaxTotalProgress) { + }, + + onStateChange: function (aBrowser, aWebProgress, aRequest, aStateFlags, aStatus) { + }, + + onLocationChange: function (aBrowser, aWebProgress, aRequest, aLocationURI) { + }, + + onStatusChange: function (aBrowser, aWebProgress, aRequest, aStatus, aMessage) { + }, + + onRefreshAttempted: function (aBrowser, aWebProgress, aURI, aDelay, aSameURI) { + if (gPrefService.getBoolPref("accessibility.blockautorefresh")) { + let brandBundle = document.getElementById("bundle_brand"); + let brandShortName = brandBundle.getString("brandShortName"); + let refreshButtonText = + gNavigatorBundle.getString("refreshBlocked.goButton"); + let refreshButtonAccesskey = + gNavigatorBundle.getString("refreshBlocked.goButton.accesskey"); + let message = + gNavigatorBundle.getFormattedString(aSameURI ? "refreshBlocked.refreshLabel" + : "refreshBlocked.redirectLabel", + [brandShortName]); + let docShell = aWebProgress.DOMWindow + .QueryInterface(Ci.nsIInterfaceRequestor) + .getInterface(Ci.nsIWebNavigation) + .QueryInterface(Ci.nsIDocShell); + let notificationBox = gBrowser.getNotificationBox(aBrowser); + let notification = notificationBox.getNotificationWithValue("refresh-blocked"); + if (notification) { + notification.label = message; + notification.refreshURI = aURI; + notification.delay = aDelay; + notification.docShell = docShell; + } else { + let buttons = [{ + label: refreshButtonText, + accessKey: refreshButtonAccesskey, + callback: function (aNotification, aButton) { + var refreshURI = aNotification.docShell + .QueryInterface(Ci.nsIRefreshURI); + refreshURI.forceRefreshURI(aNotification.refreshURI, + aNotification.delay, true); + } + }]; + notification = + notificationBox.appendNotification(message, "refresh-blocked", + "chrome://browser/skin/Info.png", + notificationBox.PRIORITY_INFO_MEDIUM, + buttons); + notification.refreshURI = aURI; + notification.delay = aDelay; + notification.docShell = docShell; + } + return false; + } + return true; + }, + + onSecurityChange: function (aBrowser, aWebProgress, aRequest, aState) { + } +} + function nsBrowserAccess() { } diff --git a/browser/base/content/browser.xul b/browser/base/content/browser.xul index 90a31e3bfa7d..8a01e78d0977 100644 --- a/browser/base/content/browser.xul +++ b/browser/base/content/browser.xul @@ -271,9 +271,9 @@ - +