| Index: Source/devtools/front_end/main/Main.js
|
| diff --git a/Source/devtools/front_end/main/Main.js b/Source/devtools/front_end/main/Main.js
|
| index 15a90efe4d70583ce9f6ec2b0d70362009bdcb78..ce19dd92023174e96f52c216928f54749fa96fd9 100644
|
| --- a/Source/devtools/front_end/main/Main.js
|
| +++ b/Source/devtools/front_end/main/Main.js
|
| @@ -117,21 +117,49 @@ WebInspector.Main.prototype = {
|
|
|
| if (InspectorFrontendHost.isUnderTest())
|
| self.runtime.useTestBase();
|
| - this._createSettings();
|
| - this._createAppUI();
|
| + InspectorFrontendHost.getPreferences(this._createSettings.bind(this));
|
| },
|
|
|
| - _createSettings: function()
|
| + /**
|
| + * @param {!Object<string, string>} prefs
|
| + */
|
| + _createSettings: function(prefs)
|
| {
|
| - this._initializeExperiments();
|
| - WebInspector.settings = new WebInspector.Settings();
|
| + this._initializeExperiments(prefs);
|
| +
|
| + /**
|
| + * @param {!Array<{name: string}>} changes
|
| + */
|
| + function trackPrefsObject(changes)
|
| + {
|
| + if (!Object.keys(prefs).length) {
|
| + InspectorFrontendHost.clearPreferences();
|
| + return;
|
| + }
|
| +
|
| + for (var change of changes) {
|
| + var name = change.name;
|
| + if (name in prefs)
|
| + InspectorFrontendHost.setPreference(name, prefs[name]);
|
| + else
|
| + InspectorFrontendHost.removePreference(name);
|
| + }
|
| + }
|
| +
|
| + Object.observe(prefs, trackPrefsObject);
|
| + WebInspector.settings = new WebInspector.Settings(prefs);
|
|
|
| // This setting is needed for backwards compatibility with Devtools CodeSchool extension. DO NOT REMOVE
|
| WebInspector.settings.pauseOnExceptionStateString = new WebInspector.PauseOnExceptionStateSetting();
|
| new WebInspector.VersionController().updateVersion();
|
| +
|
| + this._createAppUI();
|
| },
|
|
|
| - _initializeExperiments: function()
|
| + /**
|
| + * @param {!Object<string, string>} prefs
|
| + */
|
| + _initializeExperiments: function(prefs)
|
| {
|
| Runtime.experiments.register("accessibilityInspection", "Accessibility Inspection", true);
|
| Runtime.experiments.register("animationInspection", "Animation Inspection");
|
| @@ -161,8 +189,8 @@ WebInspector.Main.prototype = {
|
| Runtime.experiments.cleanUpStaleExperiments();
|
|
|
| if (InspectorFrontendHost.isUnderTest()) {
|
| + var testPath = JSON.parse(prefs["testPath"] || "\"\"");
|
| // Enable experiments for testing.
|
| - var testPath = self.localStorage ? self.localStorage["testPath"] || "" : "";
|
| if (testPath.indexOf("debugger/promise") !== -1)
|
| Runtime.experiments.enableForTest("promiseTracker");
|
| if (testPath.indexOf("elements/") !== -1)
|
|
|