diff --git a/browser/base/content/browser.css b/browser/base/content/browser.css index c2313a573f67..897d9f6f468b 100644 --- a/browser/base/content/browser.css +++ b/browser/base/content/browser.css @@ -23,6 +23,11 @@ toolbar[printpreview="true"] { -moz-binding: url("chrome://browser/content/urlbarBindings.xml#urlbar-rich-result-popup"); } +#urlbar-throbber:not([busy="true"]), +#urlbar-throbber[busy="true"] + #page-proxy-favicon { + display: none; +} + /* ::::: Unified Back-/Forward Button ::::: */ #back-forward-dropmarker > image , #back-forward-dropmarker > label { diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index e6b7ee3557a7..1de02423450b 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -75,9 +75,7 @@ var gLastBrowserCharset = null; var gPrevCharset = null; var gURLBar = null; var gFindBar = null; -var gProxyButton = null; var gProxyFavIcon = null; -var gProxyDeck = null; var gNavigatorBundle = null; var gIsLoadingBlank = false; var gLastValidURLStr = ""; @@ -2108,6 +2106,28 @@ function UpdateUrlbarSearchSplitterState() splitter.parentNode.removeChild(splitter); } +var LocationBarHelpers = { + _timeoutID: null, + + _searchBegin: function LocBar_searchBegin() { + function delayedBegin(self) { + self._timeoutID = null; + document.getElementById("urlbar-throbber").setAttribute("busy", "true"); + } + + this._timeoutID = setTimeout(delayedBegin, 500, this); + }, + + _searchComplete: function LocBar_searchComplete() { + // Did we finish the search before delayedBegin was invoked? + if (this._timeoutID) { + clearTimeout(this._timeoutID); + this._timeoutID = null; + } + document.getElementById("urlbar-throbber").removeAttribute("busy"); + } +}; + function UpdatePageProxyState() { if (gURLBar && gURLBar.value != gLastValidURLStr) @@ -2119,15 +2139,11 @@ function SetPageProxyState(aState) if (!gURLBar) return; - if (!gProxyButton) - gProxyButton = document.getElementById("page-proxy-button"); if (!gProxyFavIcon) gProxyFavIcon = document.getElementById("page-proxy-favicon"); - if (!gProxyDeck) - gProxyDeck = document.getElementById("page-proxy-deck"); gURLBar.setAttribute("pageproxystate", aState); - gProxyButton.setAttribute("pageproxystate", aState); + gProxyFavIcon.setAttribute("pageproxystate", aState); // the page proxy state is set to valid via OnLocationChange, which // gets called when we switch tabs. @@ -2151,21 +2167,17 @@ function PageProxySetIcon (aURL) PageProxyClearIcon(); else if (gProxyFavIcon.getAttribute("src") != aURL) gProxyFavIcon.setAttribute("src", aURL); - else if (gProxyDeck.selectedIndex != 1) - gProxyDeck.selectedIndex = 1; } function PageProxyClearIcon () { - if (gProxyDeck.selectedIndex != 0) - gProxyDeck.selectedIndex = 0; - if (gProxyFavIcon.hasAttribute("src")) - gProxyFavIcon.removeAttribute("src"); + gProxyFavIcon.removeAttribute("src"); } + function PageProxyDragGesture(aEvent) { - if (gProxyButton.getAttribute("pageproxystate") == "valid") { + if (gProxyFavIcon.getAttribute("pageproxystate") == "valid") { nsDragAndDrop.startDrag(aEvent, proxyIconDNDObserver); return true; } @@ -3123,9 +3135,7 @@ function BrowserToolboxCustomizeDone(aToolboxChanged) // Update global UI elements that may have been added or removed if (aToolboxChanged) { gURLBar = document.getElementById("urlbar"); - gProxyButton = document.getElementById("page-proxy-button"); gProxyFavIcon = document.getElementById("page-proxy-favicon"); - gProxyDeck = document.getElementById("page-proxy-deck"); gHomeButton.updateTooltip(); gIdentityHandler._cacheElements(); window.XULBrowserWindow.init(); diff --git a/browser/base/content/browser.xul b/browser/base/content/browser.xul index 85b42a7385b6..6a9b79d99589 100644 --- a/browser/base/content/browser.xul +++ b/browser/base/content/browser.xul @@ -307,6 +307,8 @@ ontextentered="return handleURLBarCommand(param);" ontextreverted="return handleURLBarRevert();" pageproxystate="invalid" + onsearchbegin="LocationBarHelpers._searchBegin();" + onsearchcomplete="LocationBarHelpers._searchComplete();" onfocus="document.getElementById('identity-box').style.MozUserFocus= 'normal'" onblur="document.getElementById('identity-box').style.MozUserFocus = 'ignore';">