зеркало из https://github.com/mozilla/gecko-dev.git
Bug 854126 - Enable lightweight themes in private windows;r=dao
MozReview-Commit-ID: D8nZY6lzgNV --HG-- extra : rebase_source : 0ce147298e0cc4461865c005a44cbe96b4946cfa
This commit is contained in:
Родитель
d4ced30f67
Коммит
a7a654cb56
|
@ -13,20 +13,12 @@ Cu.import("resource://gre/modules/AppConstants.jsm");
|
|||
XPCOMUtils.defineLazyModuleGetter(this, "LightweightThemeImageOptimizer",
|
||||
"resource://gre/modules/addons/LightweightThemeImageOptimizer.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
|
||||
"resource://gre/modules/PrivateBrowsingUtils.jsm");
|
||||
|
||||
this.LightweightThemeConsumer =
|
||||
function LightweightThemeConsumer(aDocument) {
|
||||
this._doc = aDocument;
|
||||
this._win = aDocument.defaultView;
|
||||
this._footerId = aDocument.documentElement.getAttribute("lightweightthemesfooter");
|
||||
|
||||
if (PrivateBrowsingUtils.isWindowPrivate(this._win) &&
|
||||
!PrivateBrowsingUtils.permanentPrivateBrowsing) {
|
||||
return;
|
||||
}
|
||||
|
||||
let screen = this._win.screen;
|
||||
this._lastScreenWidth = screen.width;
|
||||
this._lastScreenHeight = screen.height;
|
||||
|
@ -87,12 +79,9 @@ LightweightThemeConsumer.prototype = {
|
|||
},
|
||||
|
||||
destroy() {
|
||||
if (!PrivateBrowsingUtils.isWindowPrivate(this._win) ||
|
||||
PrivateBrowsingUtils.permanentPrivateBrowsing) {
|
||||
Services.obs.removeObserver(this, "lightweight-theme-styling-update");
|
||||
Services.obs.removeObserver(this, "lightweight-theme-styling-update");
|
||||
|
||||
this._win.removeEventListener("resize", this);
|
||||
}
|
||||
this._win.removeEventListener("resize", this);
|
||||
|
||||
this._win = this._doc = null;
|
||||
},
|
||||
|
|
Загрузка…
Ссылка в новой задаче