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

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: 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..8ecb7fbcdbb8b35b666408860898469e74da2305 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,17 @@ WebInspector.Main = class {
if (InspectorFrontendHost.isUnderTest())
self.runtime.useTestBase();
Runtime.setPlatform(WebInspector.platform());
- InspectorFrontendHost.getPreferences(this._gotPreferences.bind(this));
+ if (this._shouldUseLocalStorage())
+ WebInspector.InspectorFrontendHostStub.prototype.getPreferences.call(null, this._gotPreferences.bind(this));
+ else
+ InspectorFrontendHost.getPreferences(this._gotPreferences.bind(this));
+ }
+
+ /**
+ * @return {boolean}
dgozman 2016/11/02 17:31:57 I'd suggest to return InspectorFrontendHostAPI fro
lushnikov 2016/11/02 18:48:59 Done.
+ */
+ _shouldUseLocalStorage() {
+ return window.location.toString().startsWith('chrome-devtools://devtools/custom/');
}
/**
@@ -73,9 +83,15 @@ WebInspector.Main = class {
*/
_createSettings(prefs) {
this._initializeExperiments(prefs);
- WebInspector.settings = new WebInspector.Settings(new WebInspector.SettingsStorage(
- prefs, InspectorFrontendHost.setPreference, InspectorFrontendHost.removePreference,
- InspectorFrontendHost.clearPreferences));
+ if (this._shouldUseLocalStorage()) {
+ WebInspector.settings = new WebInspector.Settings(new WebInspector.SettingsStorage(
+ prefs, WebInspector.InspectorFrontendHostStub.prototype.setPreference, WebInspector.InspectorFrontendHostStub.prototype.removePreference,
+ WebInspector.InspectorFrontendHostStub.prototype.clearPreferences));
+ } else {
+ WebInspector.settings = new WebInspector.Settings(new WebInspector.SettingsStorage(
+ prefs, InspectorFrontendHost.setPreference, InspectorFrontendHost.removePreference,
+ InspectorFrontendHost.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