Bug 564285 - Remember password infobar is overlapped by the url bar, while loading [r=mfinkle]
--- a/mobile/chrome/content/browser-ui.js
+++ b/mobile/chrome/content/browser-ui.js
@@ -446,36 +446,44 @@ var BrowserUI = {
}, true);
},
uninit : function() {
ExtensionsView.uninit();
ConsoleView.uninit();
},
+ _shouldUnlockToolbar: false, // See bug 564285
update : function(aState) {
let icons = document.getElementById("urlbar-icons");
let browser = Browser.selectedBrowser;
switch (aState) {
case TOOLBARSTATE_LOADED:
if (icons.getAttribute("mode") != "edit")
this._updateToolbar();
this._updateIcon(browser.mIconURL);
- this.unlockToolbar();
+ if (this._shouldUnlockToolbar) {
+ this._shouldUnlockToolbar = false;
+ this.unlockToolbar();
+ }
break;
case TOOLBARSTATE_LOADING:
if (icons.getAttribute("mode") != "edit")
this._updateToolbar();
browser.mIconURL = "";
this._updateIcon();
- this.lockToolbar();
+
+ if (!Browser.hasNotificationsForTab(Browser.selectedTab)) {
+ this._shouldUnlockToolbar = true;
+ this.lockToolbar();
+ }
break;
}
},
_updateIcon : function(aIconSrc) {
this._favicon.src = aIconSrc || "";
if (Browser.selectedTab.isLoading()) {
this._throbber.hidden = false;
--- a/mobile/chrome/content/browser.js
+++ b/mobile/chrome/content/browser.js
@@ -877,16 +877,27 @@ var Browser = {
if (notification.persistence)
notification.persistence--;
else if (Date.now() > notification.timeout)
notificationBox.removeNotification(notification);
}
},
+ hasNotificationsForTab: function hasNotificationsForTab(aTab) {
+ let notifications = this.getNotificationBox().allNotifications;
+ for (let n = notifications.length - 1; n >= 0; n--) {
+ let notification = notifications[n];
+ if (notification._chromeTab == aTab.chromeTab)
+ return true;
+ }
+
+ return false;
+ },
+
/** Returns true iff a tab's browser has been destroyed to free up memory. */
sacrificeTab: function sacrificeTab() {
let tabToClear = this._tabs.reduce(function(prevTab, currentTab) {
if (currentTab == Browser.selectedTab || !currentTab.browser) {
return prevTab;
} else {
return (prevTab && prevTab.lastSelected <= currentTab.lastSelected) ? prevTab : currentTab;
}