Bug 1315317 - Make sure PopupNotification reshows only occur when the tab is in the foreground. r=Gijs

MozReview-Commit-ID: CHnE28MNXXn

--HG--
extra : rebase_source : dde325893866eb5e07e3f9b807dfbb91db286da7
extra : histedit_source : 1c7c3d5e2f6433f251dd94ffc31dc57d98caf7c4
This commit is contained in:
Mike Conley 2016-11-04 18:14:52 -04:00
parent 4c52336d53
commit ef7dad35cf

View File

@ -1109,14 +1109,17 @@ PopupNotifications.prototype = {
_reshowNotifications: function PopupNotifications_reshowNotifications(anchor, browser) {
// Mark notifications anchored to this anchor as un-dismissed
let notifications = this._getNotificationsForBrowser(browser || this.tabbrowser.selectedBrowser);
browser = browser || this.tabbrowser.selectedBrowser;
let notifications = this._getNotificationsForBrowser(browser);
notifications.forEach(function (n) {
if (n.anchorElement == anchor)
n.dismissed = false;
});
// ...and then show them.
this._update(notifications, anchor);
if (this._isActiveBrowser(browser)) {
// ...and then show them.
this._update(notifications, anchor);
}
},
_swapBrowserNotifications: function PopupNotifications_swapBrowserNoficications(ourBrowser, otherBrowser) {