Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(690)

Unified Diff: third_party/WebKit/Source/devtools/front_end/main/Main.js

Issue 2474563002: DevTools: isolate settings of custom devtoools front-end. (Closed)
Patch Set: DevTools: custom devtools front-end should not share settings Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/main/Main.js
diff --git a/third_party/WebKit/Source/devtools/front_end/main/Main.js b/third_party/WebKit/Source/devtools/front_end/main/Main.js
index 5df24c9ca10ccbeb1f17ff1c9a0c55d5ce5d69ef..baff58897b9c69c2cf4dc0906a84b5d4cf9d6b15 100644
--- a/third_party/WebKit/Source/devtools/front_end/main/Main.js
+++ b/third_party/WebKit/Source/devtools/front_end/main/Main.js
@@ -55,7 +55,18 @@ WebInspector.Main = class {
if (InspectorFrontendHost.isUnderTest())
self.runtime.useTestBase();
Runtime.setPlatform(WebInspector.platform());
- InspectorFrontendHost.getPreferences(this._gotPreferences.bind(this));
+ this._preferencesProvider().getPreferences(this._gotPreferences.bind(this));
+ }
+
+ /**
+ * @return {!InspectorFrontendHostAPI}
+ */
+ _preferencesProvider() {
+ if (this._preferencesProviderInstance)
+ return this._preferencesProviderInstance;
+ var isCustomFrontend = window.location.toString().startsWith('chrome-devtools://devtools/custom/');
+ this._preferencesProviderInstance = isCustomFrontend ? new WebInspector.InspectorFrontendHostStub() : InspectorFrontendHost;
+ return this._preferencesProviderInstance;
}
/**
@@ -73,9 +84,10 @@ WebInspector.Main = class {
*/
_createSettings(prefs) {
this._initializeExperiments(prefs);
+ var preferencesProvider = this._preferencesProvider();
WebInspector.settings = new WebInspector.Settings(new WebInspector.SettingsStorage(
- prefs, InspectorFrontendHost.setPreference, InspectorFrontendHost.removePreference,
- InspectorFrontendHost.clearPreferences));
+ prefs, preferencesProvider.setPreference, preferencesProvider.removePreference,
dgozman 2016/11/02 19:47:58 Don't you have to bind here?
lushnikov 2016/11/02 20:00:59 It's not required, but let's bind to be on the saf
+ preferencesProvider.clearPreferences));
if (!InspectorFrontendHost.isUnderTest())
new WebInspector.VersionController().updateVersion();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698