Bug 1464719 - Remove obsolete code from LightweightThemeConsumer.jsm. r=jaws
authorTim Nguyen <ntim.bugs@gmail.com>
Mon, 28 May 2018 01:31:20 +0200
changeset 478022 39a77ae8f358155181cd0e4d660b62b93150a133
parent 478021 225b70969911f6a5b45bf3282c1de6860cbd43b3
child 478023 c1d893c1e41f318d9a49da1db34011ea9cf628fa
push id1757
push userffxbld-merge
push dateFri, 24 Aug 2018 17:02:43 +0000
treeherdermozilla-release@736023aebdb1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws
bugs1464719
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1464719 - Remove obsolete code from LightweightThemeConsumer.jsm. r=jaws MozReview-Commit-ID: C5NMohgxj70
toolkit/modules/LightweightThemeConsumer.jsm
--- a/toolkit/modules/LightweightThemeConsumer.jsm
+++ b/toolkit/modules/LightweightThemeConsumer.jsm
@@ -103,38 +103,19 @@ function LightweightThemeConsumer(aDocum
   this._update(temp.LightweightThemeManager.currentThemeForDisplay);
 
   this._win.addEventListener("resolutionchange", this);
   this._win.addEventListener("unload", this, { once: true });
 }
 
 LightweightThemeConsumer.prototype = {
   _lastData: null,
-  // Whether the active lightweight theme should be shown on the window.
-  _enabled: true,
   // Whether a lightweight theme is enabled.
   _active: false,
 
-  enable() {
-    this._enabled = true;
-    this._update(this._lastData);
-  },
-
-  disable() {
-    // Dance to keep the data, but reset the applied styles:
-    let lastData = this._lastData;
-    this._update(null);
-    this._enabled = false;
-    this._lastData = lastData;
-  },
-
-  getData() {
-    return this._enabled ? Cu.cloneInto(this._lastData, this._win) : null;
-  },
-
   observe(aSubject, aTopic, aData) {
     if (aTopic != "lightweight-theme-styling-update")
       return;
 
     const { outerWindowID } = this._win
       .QueryInterface(Ci.nsIInterfaceRequestor)
       .getInterface(Ci.nsIDOMWindowUtils);
 
@@ -164,18 +145,16 @@ LightweightThemeConsumer.prototype = {
   _update(aData) {
     if (!aData) {
       aData = { headerURL: "", footerURL: "", textcolor: "", accentcolor: "" };
       this._lastData = aData;
     } else {
       this._lastData = aData;
       aData = LightweightThemeImageOptimizer.optimize(aData, this._win.screen);
     }
-    if (!this._enabled)
-      return;
 
     let root = this._doc.documentElement;
 
     if (aData.headerURL) {
       root.setAttribute("lwtheme-image", "true");
     } else {
       root.removeAttribute("lwtheme-image");
     }
@@ -204,19 +183,16 @@ LightweightThemeConsumer.prototype = {
       root.removeAttribute("lwtheme");
       root.removeAttribute("lwthemetextcolor");
     }
 
     if (active && aData.footerURL)
       root.setAttribute("lwthemefooter", "true");
     else
       root.removeAttribute("lwthemefooter");
-
-    Services.obs.notifyObservers(this._win, "lightweight-theme-window-updated",
-                                 JSON.stringify(aData));
   }
 };
 
 function _setImage(aRoot, aActive, aVariableName, aURLs) {
   if (aURLs && !Array.isArray(aURLs)) {
     aURLs = [aURLs];
   }
   _setProperty(aRoot, aActive, aVariableName, aURLs && aURLs.map(v => `url("${v.replace(/"/g, '\\"')}")`).join(","));