Bug 1329262 - Remove verifyConfigHelper call;r=MattN draft
authorBrian Grinstead <bgrinstead@mozilla.com>
Thu, 19 Jan 2017 14:12:14 -0800
changeset 463868 d2cccfee36d3fd6894652d13eb8426af0e9699ea
parent 463867 3feabf2302c50f2d0b14961068188c0aef3202f3
child 542798 8dea309e598e800a13e473456dd92f9e52a4a98a
push id42203
push userbgrinstead@mozilla.com
push dateThu, 19 Jan 2017 22:18:52 +0000
reviewersMattN
bugs1329262, 854126
milestone53.0a1
Bug 1329262 - Remove verifyConfigHelper call;r=MattN Since Bug 854126 landed there's not a restriction on private windows with lightweight themes anymore and no need for this verification MozReview-Commit-ID: 4uQxfbtqO7G
browser/tools/mozscreenshots/mozscreenshots/extension/configurations/LightweightThemes.jsm
--- a/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/LightweightThemes.jsm
+++ b/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/LightweightThemes.jsm
@@ -46,18 +46,16 @@ this.LightweightThemes = {
 
         // Wait for LWT listener
         return new Promise(resolve => {
           setTimeout(() => {
             resolve("darkLWT");
           }, 500);
         });
       },
-
-      verifyConfig: verifyConfigHelper,
     },
 
     lightLWT: {
       applyConfig() {
         LightweightThemeManager.setLocalTheme({
           id:          "white",
           name:        "white",
           headerURL:   LightweightThemes._whiteImageURL,
@@ -67,37 +65,23 @@ this.LightweightThemes = {
         });
         // Wait for LWT listener
         return new Promise(resolve => {
           setTimeout(() => {
             resolve("lightLWT");
           }, 500);
         });
       },
-
-      verifyConfig: verifyConfigHelper,
     },
 
     compactLight: {
       applyConfig: Task.async(() => {
         LightweightThemeManager.currentTheme = LightweightThemeManager.getUsedTheme("firefox-compact-light@mozilla.org");
       }),
     },
 
     compactDark: {
       applyConfig: Task.async(() => {
         LightweightThemeManager.currentTheme = LightweightThemeManager.getUsedTheme("firefox-compact-dark@mozilla.org");
       }),
     },
   },
 };
-
-
-function verifyConfigHelper() {
-  return new Promise((resolve, reject) => {
-    let browserWindow = Services.wm.getMostRecentWindow("navigator:browser");
-    if (browserWindow.document.documentElement.hasAttribute("lwtheme")) {
-      resolve("verifyConfigHelper");
-    } else {
-      reject("The @lwtheme attribute wasn't present so themes may not be available");
-    }
-  });
-}