Bug 537717 - need feedback that navigation has started when url bar is offscreen [r=mfinkle]
authorVivien Nicolas <21@vingtetun.org>
Fri, 30 Apr 2010 01:28:40 -0400
changeset 66189 f55884308423db960c326a10d5cd9f997208ad7f
parent 66188 23267cbaa936c20d9c1a7e069e2de1280e61f9c4
child 66190 200728267ad45cfb73b2f2dfd8a722056cf924f5
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs537717
Bug 537717 - need feedback that navigation has started when url bar is offscreen [r=mfinkle]
mobile/chrome/content/browser-ui.js
--- a/mobile/chrome/content/browser-ui.js
+++ b/mobile/chrome/content/browser-ui.js
@@ -190,30 +190,33 @@ var BrowserUI = {
   _updateButtons : function(aBrowser) {
     let back = document.getElementById("cmd_back");
     let forward = document.getElementById("cmd_forward");
 
     back.setAttribute("disabled", !aBrowser.canGoBack);
     forward.setAttribute("disabled", !aBrowser.canGoForward);
   },
 
-  _updateToolbarButton: function() {
+  _updateToolbar: function _updateToolbar() {
     let icons = document.getElementById("urlbar-icons");
     if (Browser.selectedTab.isLoading() && icons.getAttribute("mode") != "loading") {
+      this.lockToolbar();
       icons.setAttribute("mode", "loading");
     }
     else if (icons.getAttribute("mode") != "view") {
+      if (this.isToolbarLocked())
+        this.unlockToolbar();
       icons.setAttribute("mode", "view");
     }
   },
 
   _tabSelect : function(aEvent) {
     let browser = Browser.selectedBrowser;
     this._titleChanged(browser.contentDocument);
-    this._updateToolbarButton();
+    this._updateToolbar();
     this._updateButtons(browser);
     this._updateIcon(browser.mIconURL);
     this.updateStar();
   },
 
   showToolbar : function showToolbar(aEdit) {
     this.hidePanel();
     this._editURI(aEdit);
@@ -261,17 +264,17 @@ var BrowserUI = {
 
       // This is a workaround for bug 488420, needed to cycle focus for the
       // IME state to be set properly. Testing shows we only really need to
       // do this the first time.
       this._edit.blur();
       gFocusManager.setFocus(this._edit, Ci.nsIFocusManager.FLAG_NOSCROLL);
     }
     else if (!aEdit) {
-      this._updateToolbarButton();
+      this._updateToolbar();
     }
   },
 
   _closeOrQuit: function _closeOrQuit() {
     // Close active dialog, if we have one. If not then close the application.
     let dialog = this.activeDialog;
     if (dialog) {
       dialog.close();
@@ -452,24 +455,24 @@ var BrowserUI = {
 
   update : function(aState) {
     let icons = document.getElementById("urlbar-icons");
     let browser = Browser.selectedBrowser;
 
     switch (aState) {
       case TOOLBARSTATE_LOADED:
         if (icons.getAttribute("mode") != "edit")
-          icons.setAttribute("mode", "view");
+          this._updateToolbar();
 
         this._updateIcon(browser.mIconURL);
         break;
 
       case TOOLBARSTATE_LOADING:
         if (icons.getAttribute("mode") != "edit")
-          icons.setAttribute("mode", "loading");
+          this._updateToolbar();
 
         browser.mIconURL = "";
         this._updateIcon();
         break;
     }
   },
 
   _updateIcon : function(aIconSrc) {