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

Unified Diff: content/shell/browser/shell_devtools_frontend.cc

Issue 2177983004: [DevTools] Do not use "settings" query param. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleanup Created 4 years, 5 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: content/shell/browser/shell_devtools_frontend.cc
diff --git a/content/shell/browser/shell_devtools_frontend.cc b/content/shell/browser/shell_devtools_frontend.cc
index d4ffd09b7f7866ed29409315485d797dde6cbb10..9b597db955a4c32bf9315e007a63d3e7645f3685 100644
--- a/content/shell/browser/shell_devtools_frontend.cc
+++ b/content/shell/browser/shell_devtools_frontend.cc
@@ -193,6 +193,21 @@ void ShellDevToolsFrontend::WebContentsDestroyed() {
delete this;
}
+void ShellDevToolsFrontend::SetPreferences(const std::string& json) {
+ preferences_.Clear();
+ if (json.empty())
+ return;
+ base::DictionaryValue* dict = nullptr;
+ std::unique_ptr<base::Value> parsed = base::JSONReader::Read(json);
+ if (!parsed || !parsed->GetAsDictionary(&dict))
+ return;
+ for (base::DictionaryValue::Iterator it(*dict); !it.IsAtEnd(); it.Advance()) {
+ if (!it.value().IsType(base::Value::TYPE_STRING))
+ continue;
+ preferences_.SetWithoutPathExpansion(it.key(), it.value().CreateDeepCopy());
+ }
+}
+
void ShellDevToolsFrontend::HandleMessageFromDevToolsFrontend(
const std::string& message) {
if (!agent_host_)
« no previous file with comments | « content/shell/browser/shell_devtools_frontend.h ('k') | third_party/WebKit/Source/devtools/front_end/devtools.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698