Bug 854126 - Enable lightweight themes in private windows;r=dao

MozReview-Commit-ID: D8nZY6lzgNV

--HG--
extra : rebase_source : 0ce147298e0cc4461865c005a44cbe96b4946cfa
This commit is contained in:
Brian Grinstead 2017-01-17 09:23:29 -08:00
Родитель d4ced30f67
Коммит a7a654cb56
1 изменённых файлов: 2 добавлений и 13 удалений

Просмотреть файл

@ -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;
},