Bug 854126 - Enable lightweight themes in private windows;r=dao draft
authorBrian Grinstead <bgrinstead@mozilla.com>
Tue, 17 Jan 2017 09:23:29 -0800
changeset 462526 0ce147298e0cc4461865c005a44cbe96b4946cfa
parent 462285 88030580b14bb253a55bc174c987a9fa43c3fb55
child 542432 9a5d8cb9fa56a64db47e87629f9db533d9b2ad95
push id41792
push userbgrinstead@mozilla.com
push dateTue, 17 Jan 2017 17:24:04 +0000
reviewersdao
bugs854126
milestone53.0a1
Bug 854126 - Enable lightweight themes in private windows;r=dao MozReview-Commit-ID: D8nZY6lzgNV
toolkit/modules/LightweightThemeConsumer.jsm
--- 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;