mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-03 10:33:33 +00:00
Backed out changeset 30e050c04c4e r=mconley
MozReview-Commit-ID: HLTpejFKnY9 --HG-- extra : rebase_source : 698964b8d471a353066bcdedf23bf9512cb71b23
This commit is contained in:
parent
ac4c44867e
commit
bad456c8e3
@ -419,7 +419,7 @@ PopupNotifications.prototype = {
|
||||
let notifications = this._getNotificationsForBrowser(browser);
|
||||
notifications.push(notification);
|
||||
|
||||
let isActiveBrowser = browser.docShellIsActive;
|
||||
let isActiveBrowser = this._isActiveBrowser(browser);
|
||||
let fm = Cc["@mozilla.org/focus-manager;1"].getService(Ci.nsIFocusManager);
|
||||
let isActiveWindow = fm.activeWindow == this.window;
|
||||
|
||||
@ -495,7 +495,7 @@ PopupNotifications.prototype = {
|
||||
|
||||
this._setNotificationsForBrowser(aBrowser, notifications);
|
||||
|
||||
if (aBrowser.docShellIsActive) {
|
||||
if (this._isActiveBrowser(aBrowser)) {
|
||||
// get the anchor element if the browser has defined one so it will
|
||||
// _update will handle both the tabs iconBox and non-tab permission
|
||||
// anchors.
|
||||
@ -512,7 +512,7 @@ PopupNotifications.prototype = {
|
||||
remove: function PopupNotifications_remove(notification) {
|
||||
this._remove(notification);
|
||||
|
||||
if (notification.browser.docShellIsActive) {
|
||||
if (this._isActiveBrowser(notification.browser)) {
|
||||
let notifications = this._getNotificationsForBrowser(notification.browser);
|
||||
this._update(notifications);
|
||||
}
|
||||
@ -570,7 +570,7 @@ PopupNotifications.prototype = {
|
||||
if (index == -1)
|
||||
return;
|
||||
|
||||
if (notification.browser.docShellIsActive)
|
||||
if (this._isActiveBrowser(notification.browser))
|
||||
notification.anchorElement.removeAttribute(ICON_ATTRIBUTE_SHOWING);
|
||||
|
||||
// remove the notification
|
||||
@ -1053,6 +1053,14 @@ PopupNotifications.prototype = {
|
||||
return anchors;
|
||||
},
|
||||
|
||||
_isActiveBrowser: function (browser) {
|
||||
// Note: This helper only exists, because in e10s builds,
|
||||
// we can't access the docShell of a browser from chrome.
|
||||
return browser.docShell
|
||||
? browser.docShell.isActive
|
||||
: (this.window.gBrowser.selectedBrowser == browser);
|
||||
},
|
||||
|
||||
_onIconBoxCommand: function PopupNotifications_onIconBoxCommand(event) {
|
||||
// Left click, space or enter only
|
||||
let type = event.type;
|
||||
|
Loading…
Reference in New Issue
Block a user