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

Unified Diff: Source/devtools/front_end/host/InspectorFrontendHost.js

Issue 1085253003: Revert of Revert of DevTools: allow storing devtools preferences on the browser side. [blink] (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 8 months 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
Index: Source/devtools/front_end/host/InspectorFrontendHost.js
diff --git a/Source/devtools/front_end/host/InspectorFrontendHost.js b/Source/devtools/front_end/host/InspectorFrontendHost.js
index f1f88a8e806a4901a66bb37daa6407bc53312baa..922cc7f36c636d16a659fc7e49d98a781783c082 100644
--- a/Source/devtools/front_end/host/InspectorFrontendHost.js
+++ b/Source/devtools/front_end/host/InspectorFrontendHost.js
@@ -207,6 +207,24 @@
loadNetworkResource: function(url, headers, streamId, callback) { },
/**
+ * @param {function(!Object<string, string>)} callback
+ */
+ getPreferences: function(callback) { },
+
+ /**
+ * @param {string} name
+ * @param {string} value
+ */
+ setPreference: function(name, value) { },
+
+ /**
+ * @param {string} name
+ */
+ removePreference: function(name) { },
+
+ clearPreferences: function() { },
+
+ /**
* @param {!FileSystem} fileSystem
*/
upgradeDraggedFileSystemPermissions: function(fileSystem) { },
@@ -498,6 +516,45 @@
loadNetworkResource: function(url, headers, streamId, callback)
{
callback({statusCode : 404});
+ },
+
+ /**
+ * @override
+ * @param {function(!Object<string, string>)} callback
+ */
+ getPreferences: function(callback)
+ {
+ var prefs = {};
+ for (var name in window.localStorage)
+ prefs[name] = window.localStorage[name];
+ callback(prefs);
+ },
+
+ /**
+ * @override
+ * @param {string} name
+ * @param {string} value
+ */
+ setPreference: function(name, value)
+ {
+ window.localStorage[name] = value;
+ },
+
+ /**
+ * @override
+ * @param {string} name
+ */
+ removePreference: function(name)
+ {
+ delete window.localStorage[name];
+ },
+
+ /**
+ * @override
+ */
+ clearPreferences: function()
+ {
+ window.localStorage.clear();
},
/**
« no previous file with comments | « Source/devtools/front_end/devtools_app/InspectorFrontendHostImpl.js ('k') | Source/devtools/front_end/main/Main.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698