Bug 854126 - Enable lightweight themes in private windows;r=dao
MozReview-Commit-ID: D8nZY6lzgNV
--- a/toolkit/modules/LightweightThemeConsumer.jsm
+++ b/toolkit/modules/LightweightThemeConsumer.jsm
@@ -8,30 +8,22 @@ const {utils: Cu} = Components;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
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;
Services.obs.addObserver(this, "lightweight-theme-styling-update", false);
var temp = {};
Cu.import("resource://gre/modules/LightweightThemeManager.jsm", temp);
@@ -82,22 +74,19 @@ LightweightThemeConsumer.prototype = {
return;
this._update(this._lastData);
Services.obs.notifyObservers(this._win, "lightweight-theme-optimized",
JSON.stringify(this._lastData));
}
},
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;
},
_update(aData) {
if (!aData) {
aData = { headerURL: "", footerURL: "", textcolor: "", accentcolor: "" };
this._lastData = aData;