Bug 1369801 - dt-addon-prefs: move devtools.theme preference to devtools-startup-prefs.js;r=bgrins draft
authorJulian Descottes <jdescottes@mozilla.com>
Tue, 25 Jul 2017 16:45:08 +0200
changeset 615202 59713e0a7e5ab514761e3506c6659d6b1d17bb61
parent 615201 7feb021770c827996e276b60169b08093ecc1ff0
child 615203 05d41abb69a34f0f5b8241c26684ed53a88b6df5
push id70267
push userjdescottes@mozilla.com
push dateTue, 25 Jul 2017 16:01:51 +0000
reviewersbgrins
bugs1369801
milestone56.0a1
Bug 1369801 - dt-addon-prefs: move devtools.theme preference to devtools-startup-prefs.js;r=bgrins MozReview-Commit-ID: GOWh7COmCSx
devtools/client/preferences/DevToolsPreferences.jsm
devtools/client/preferences/devtools.js
devtools/shim/devtools-startup-prefs.js
devtools/shim/moz.build
--- a/devtools/client/preferences/DevToolsPreferences.jsm
+++ b/devtools/client/preferences/DevToolsPreferences.jsm
@@ -34,17 +34,17 @@ function readURI(uri) {
  *         The string content of a preferences file.
  * @return {String} the content stripped of unnecessary lines.
  */
 function cleanupPreferencesFileContent(content) {
   let lines = content.split("\n");
   let newLines = [];
   let continuation = false;
   for (let line of lines) {
-    let isPrefLine = /^ *(sticky_)?pref\("([^"]+)"/.test(line);
+    let isPrefLine = /^ *pref\("([^"]+)"/.test(line);
     if (continuation || isPrefLine) {
       newLines.push(line);
       // The call to pref(...); might span more than one line.
       continuation = !/\);/.test(line);
     }
   }
   return newLines.join("\n");
 }
--- a/devtools/client/preferences/devtools.js
+++ b/devtools/client/preferences/devtools.js
@@ -225,23 +225,16 @@ pref("devtools.webaudioeditor.enabled", 
 pref("devtools.scratchpad.enabled", false);
 
 // Make sure the DOM panel is hidden by default
 pref("devtools.dom.enabled", false);
 
 // Web Audio Editor Inspector Width should be a preference
 pref("devtools.webaudioeditor.inspectorWidth", 300);
 
-// Default theme ("dark" or "light")
-#ifdef MOZ_DEV_EDITION
-sticky_pref("devtools.theme", "dark");
-#else
-sticky_pref("devtools.theme", "light");
-#endif
-
 // Web console filters
 pref("devtools.webconsole.filter.error", true);
 pref("devtools.webconsole.filter.warn", true);
 pref("devtools.webconsole.filter.info", true);
 pref("devtools.webconsole.filter.log", true);
 pref("devtools.webconsole.filter.debug", true);
 pref("devtools.webconsole.filter.css", false);
 pref("devtools.webconsole.filter.net", false);
--- a/devtools/shim/devtools-startup-prefs.js
+++ b/devtools/shim/devtools-startup-prefs.js
@@ -5,8 +5,15 @@
 // This Devtools preferences file will be loaded as a usual Firefox preferences file.
 // Most DevTools prefs are included with the addon and loaded dynamically during the addon
 // startup. For preferences that are required before the addon is loaded or that we can't
 // process in JS, they can be defined in this file.
 // Note that this preference file follows Firefox release cycle.
 
 // Enable the JSON View tool (an inspector for application/json documents).
 pref("devtools.jsonview.enabled", true);
+
+// Default theme ("dark" or "light")
+#ifdef MOZ_DEV_EDITION
+sticky_pref("devtools.theme", "dark");
+#else
+sticky_pref("devtools.theme", "light");
+#endif
--- a/devtools/shim/moz.build
+++ b/devtools/shim/moz.build
@@ -1,17 +1,17 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 JAR_MANIFESTS += ['jar.mn']
 
-JS_PREFERENCE_FILES += [
+JS_PREFERENCE_PP_FILES += [
     'devtools-startup-prefs.js',
 ]
 
 # Register the about:debugging page only for 'addon' and 'all' builds.
 if CONFIG['MOZ_DEVTOOLS'] != 'server':
     EXTRA_COMPONENTS += [
         'aboutdebugging-registration.js',
         'aboutdebugging.manifest',