summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-01 10:20:14 +0000
committerpfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-01 10:20:14 +0000
commitc4e9890a10fb35a78247be5d204d77f512d7654c (patch)
tree721f8deca6173a7ea06f50e991597a2fde7269de
parent0bda0e053a5d9dc61c6ab026b328873111eb2b81 (diff)
downloadchromium_src-c4e9890a10fb35a78247be5d204d77f512d7654c.zip
chromium_src-c4e9890a10fb35a78247be5d204d77f512d7654c.tar.gz
chromium_src-c4e9890a10fb35a78247be5d204d77f512d7654c.tar.bz2
DevTools: inspector settings are now serialized into map, not a string
WebKit roll 60462:60647 Original review: http://codereview.chromium.org/2422001 Review URL: http://codereview.chromium.org/2459002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48628 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--DEPS2
-rwxr-xr-x[-rw-r--r--]chrome/browser/debugger/devtools_sanity_unittest.cc10
-rw-r--r--chrome/browser/renderer_host/render_view_host.cc10
-rw-r--r--chrome/browser/renderer_host/render_view_host.h4
-rw-r--r--chrome/browser/renderer_host/render_view_host_delegate.h5
-rw-r--r--chrome/browser/tab_contents/render_view_host_delegate_helper.cc13
-rw-r--r--chrome/browser/tab_contents/tab_contents.cc12
-rw-r--r--chrome/browser/tab_contents/tab_contents.h3
-rw-r--r--chrome/common/render_messages_internal.h7
-rwxr-xr-x[-rw-r--r--]chrome/renderer/render_view.cc8
-rw-r--r--chrome/renderer/render_view.h3
-rwxr-xr-x[-rw-r--r--]webkit/glue/webpreferences.cc6
-rwxr-xr-x[-rw-r--r--]webkit/glue/webpreferences.h5
13 files changed, 57 insertions, 31 deletions
diff --git a/DEPS b/DEPS
index 7c22b70..7386422 100644
--- a/DEPS
+++ b/DEPS
@@ -1,7 +1,7 @@
vars = {
"webkit_trunk":
"http://svn.webkit.org/repository/webkit/trunk",
- "webkit_revision": "60462",
+ "webkit_revision": "60467",
"ffmpeg_revision": "47712",
"skia_revision": "562",
"chromium_git": "http://src.chromium.org/git",
diff --git a/chrome/browser/debugger/devtools_sanity_unittest.cc b/chrome/browser/debugger/devtools_sanity_unittest.cc
index 67f1f58..e27339b 100644..100755
--- a/chrome/browser/debugger/devtools_sanity_unittest.cc
+++ b/chrome/browser/debugger/devtools_sanity_unittest.cc
@@ -321,13 +321,17 @@ IN_PROC_BROWSER_TEST_F(DevToolsSanityTest,
TestScriptsTabIsPopulatedOnInspectedPageRefresh) {
// Reset inspector settings to defaults to ensure that Elements will be
// current panel when DevTools window is open.
- GetInspectedTab()->render_view_host()->delegate()->UpdateInspectorSettings(
- WebPreferences().inspector_settings);
+ const WebPreferences::WebInspectorPreferences& settings =
+ WebPreferences().inspector_settings;
+ WebPreferences::WebInspectorPreferences::const_iterator it =
+ settings.begin();
+ for ( ; it != settings.end(); ++it)
+ GetInspectedTab()->render_view_host()->delegate()->UpdateInspectorSetting(
+ it->first, it->second);
RunTest("testScriptsTabIsPopulatedOnInspectedPageRefresh",
kDebuggerTestPage);
}
-
// Tests that a content script is in the scripts list.
// This test is disabled, see bug 28961.
IN_PROC_BROWSER_TEST_F(DevToolsExtensionDebugTest,
diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc
index 562faac..ed1c1b4b 100644
--- a/chrome/browser/renderer_host/render_view_host.cc
+++ b/chrome/browser/renderer_host/render_view_host.cc
@@ -712,8 +712,8 @@ void RenderViewHost::OnMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateTargetURL, OnMsgUpdateTargetURL)
IPC_MESSAGE_HANDLER(ViewHostMsg_Thumbnail, OnMsgThumbnail)
IPC_MESSAGE_HANDLER(ViewHostMsg_Snapshot, OnMsgScreenshot)
- IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateInspectorSettings,
- OnUpdateInspectorSettings);
+ IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateInspectorSetting,
+ OnUpdateInspectorSetting);
IPC_MESSAGE_HANDLER(ViewHostMsg_Close, OnMsgClose)
IPC_MESSAGE_HANDLER(ViewHostMsg_RequestMove, OnMsgRequestMove)
IPC_MESSAGE_HANDLER(ViewHostMsg_DidStartLoading, OnMsgDidStartLoading)
@@ -1019,9 +1019,9 @@ void RenderViewHost::OnMsgScreenshot(const SkBitmap& bitmap) {
Details<const SkBitmap>(&bitmap));
}
-void RenderViewHost::OnUpdateInspectorSettings(
- const std::string& raw_settings) {
- delegate_->UpdateInspectorSettings(raw_settings);
+void RenderViewHost::OnUpdateInspectorSetting(
+ const std::string& key, const std::string& value) {
+ delegate_->UpdateInspectorSetting(key, value);
}
void RenderViewHost::OnMsgClose() {
diff --git a/chrome/browser/renderer_host/render_view_host.h b/chrome/browser/renderer_host/render_view_host.h
index cd97788..d789047 100644
--- a/chrome/browser/renderer_host/render_view_host.h
+++ b/chrome/browser/renderer_host/render_view_host.h
@@ -577,8 +577,8 @@ class RenderViewHost : public RenderWidgetHost {
void OnAddMessageToConsole(const std::wstring& message,
int32 line_no,
const std::wstring& source_id);
-
- void OnUpdateInspectorSettings(const std::string& raw_settings);
+ void OnUpdateInspectorSetting(const std::string& key,
+ const std::string& value);
void OnForwardToDevToolsAgent(const IPC::Message& message);
void OnForwardToDevToolsClient(const IPC::Message& message);
void OnActivateDevToolsWindow();
diff --git a/chrome/browser/renderer_host/render_view_host_delegate.h b/chrome/browser/renderer_host/render_view_host_delegate.h
index 6fc89bf..ac3198c 100644
--- a/chrome/browser/renderer_host/render_view_host_delegate.h
+++ b/chrome/browser/renderer_host/render_view_host_delegate.h
@@ -516,8 +516,9 @@ class RenderViewHostDelegate {
const SkBitmap& bitmap,
const ThumbnailScore& score) {}
- // Inspector settings were changes and should be persisted.
- virtual void UpdateInspectorSettings(const std::string& raw_settings) {}
+ // Inspector setting was changed and should be persisted.
+ virtual void UpdateInspectorSetting(const std::string& key,
+ const std::string& value) {}
// The page is trying to close the RenderView's representation in the client.
virtual void Close(RenderViewHost* render_view_host) {}
diff --git a/chrome/browser/tab_contents/render_view_host_delegate_helper.cc b/chrome/browser/tab_contents/render_view_host_delegate_helper.cc
index 590a500..2d84d45 100644
--- a/chrome/browser/tab_contents/render_view_host_delegate_helper.cc
+++ b/chrome/browser/tab_contents/render_view_host_delegate_helper.cc
@@ -188,8 +188,17 @@ WebPreferences RenderViewHostDelegateHelper::GetWebkitPrefs(
prefs->GetBoolean(prefs::kWebKitDomPasteEnabled);
web_prefs.shrinks_standalone_images_to_fit =
prefs->GetBoolean(prefs::kWebKitShrinksStandaloneImagesToFit);
- web_prefs.inspector_settings = WideToUTF8(
- prefs->GetString(prefs::kWebKitInspectorSettings));
+ const DictionaryValue* inspector_settings =
+ prefs->GetDictionary(prefs::kWebKitInspectorSettings);
+ if (inspector_settings) {
+ for (DictionaryValue::key_iterator iter(inspector_settings->begin_keys());
+ iter != inspector_settings->end_keys(); ++iter) {
+ std::string value;
+ if (inspector_settings->GetStringWithoutPathExpansion(*iter, &value))
+ web_prefs.inspector_settings.push_back(
+ std::make_pair(WideToUTF8(*iter), value));
+ }
+ }
web_prefs.tabs_to_links = prefs->GetBoolean(prefs::kWebkitTabsToLinks);
{ // Command line switches are used for preferences with no user interface.
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc
index 86ad0c5..1599737 100644
--- a/chrome/browser/tab_contents/tab_contents.cc
+++ b/chrome/browser/tab_contents/tab_contents.cc
@@ -440,8 +440,7 @@ void TabContents::RegisterUserPrefs(PrefService* prefs) {
pref_defaults.dom_paste_enabled);
prefs->RegisterBooleanPref(prefs::kWebKitShrinksStandaloneImagesToFit,
pref_defaults.shrinks_standalone_images_to_fit);
- prefs->RegisterStringPref(prefs::kWebKitInspectorSettings,
- UTF8ToWide(pref_defaults.inspector_settings));
+ prefs->RegisterDictionaryPref(prefs::kWebKitInspectorSettings);
prefs->RegisterBooleanPref(prefs::kWebKitTextAreasAreResizable,
pref_defaults.text_areas_are_resizable);
prefs->RegisterBooleanPref(prefs::kWebKitJavaEnabled,
@@ -2431,9 +2430,12 @@ void TabContents::UpdateThumbnail(const GURL& url,
}
}
-void TabContents::UpdateInspectorSettings(const std::string& raw_settings) {
- profile()->GetPrefs()->SetString(prefs::kWebKitInspectorSettings,
- UTF8ToWide(raw_settings));
+void TabContents::UpdateInspectorSetting(const std::string& key,
+ const std::string& value) {
+ DictionaryValue* inspector_settings =
+ profile()->GetPrefs()->GetMutableDictionary(
+ prefs::kWebKitInspectorSettings);
+ inspector_settings->SetString(UTF8ToWide(key), value);
}
void TabContents::Close(RenderViewHost* rvh) {
diff --git a/chrome/browser/tab_contents/tab_contents.h b/chrome/browser/tab_contents/tab_contents.h
index fa4f201..5e72cc5 100644
--- a/chrome/browser/tab_contents/tab_contents.h
+++ b/chrome/browser/tab_contents/tab_contents.h
@@ -919,7 +919,8 @@ class TabContents : public PageNavigator,
virtual void UpdateThumbnail(const GURL& url,
const SkBitmap& bitmap,
const ThumbnailScore& score);
- virtual void UpdateInspectorSettings(const std::string& raw_settings);
+ virtual void UpdateInspectorSetting(const std::string& key,
+ const std::string& value);
virtual void Close(RenderViewHost* render_view_host);
virtual void RequestMove(const gfx::Rect& new_bounds);
virtual void DidStartLoading();
diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h
index d9a0a64..c4ea9e9 100644
--- a/chrome/common/render_messages_internal.h
+++ b/chrome/common/render_messages_internal.h
@@ -1586,9 +1586,10 @@ IPC_BEGIN_MESSAGES(ViewHost)
int32, /* line number */
std::wstring /* source id */)
- // Stores new inspector settings in the profile.
- IPC_MESSAGE_ROUTED1(ViewHostMsg_UpdateInspectorSettings,
- std::string /* raw_settings */)
+ // Stores new inspector setting in the profile.
+ IPC_MESSAGE_ROUTED2(ViewHostMsg_UpdateInspectorSetting,
+ std::string, /* key */
+ std::string /* value */)
// Wraps an IPC message that's destined to the DevToolsClient on
// DevToolsAgent->browser hop.
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index df1e665..f8f3c39 100644..100755
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -1991,9 +1991,11 @@ int RenderView::historyForwardListCount() {
return history_list_length_ - historyBackListCount() - 1;
}
-void RenderView::didUpdateInspectorSettings() {
- Send(new ViewHostMsg_UpdateInspectorSettings(
- routing_id_, webview()->inspectorSettings().utf8()));
+void RenderView::didUpdateInspectorSetting(const WebString& key,
+ const WebString& value) {
+ Send(new ViewHostMsg_UpdateInspectorSetting(routing_id_,
+ key.utf8(),
+ value.utf8()));
}
void RenderView::queryAutofillSuggestions(const WebNode& node,
diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h
index 89e46a9..529f6f3 100644
--- a/chrome/renderer/render_view.h
+++ b/chrome/renderer/render_view.h
@@ -270,7 +270,8 @@ class RenderView : public RenderWidget,
const WebKit::WebAccessibilityObject& acc_obj);
virtual void didChangeAccessibilityObjectState(
const WebKit::WebAccessibilityObject& acc_obj);
- virtual void didUpdateInspectorSettings();
+ virtual void didUpdateInspectorSetting(const WebKit::WebString& key,
+ const WebKit::WebString& value);
virtual void queryAutofillSuggestions(
const WebKit::WebNode& node, const WebKit::WebString& name,
const WebKit::WebString& value);
diff --git a/webkit/glue/webpreferences.cc b/webkit/glue/webpreferences.cc
index a36a761..0db217c 100644..100755
--- a/webkit/glue/webpreferences.cc
+++ b/webkit/glue/webpreferences.cc
@@ -92,8 +92,10 @@ void WebPreferences::Apply(WebView* web_view) const {
// on command line.
settings->setShowDebugBorders(show_composited_layer_borders);
- // Web inspector settings need to be passed in differently.
- web_view->setInspectorSettings(WebString::fromUTF8(inspector_settings));
+ for (WebInspectorPreferences::const_iterator it = inspector_settings.begin();
+ it != inspector_settings.end(); ++it)
+ web_view->setInspectorSetting(WebString::fromUTF8(it->first),
+ WebString::fromUTF8(it->second));
// Tabs to link is not part of the settings. WebCore calls
// ChromeClient::tabsToLinks which is part of the glue code.
diff --git a/webkit/glue/webpreferences.h b/webkit/glue/webpreferences.h
index ec52951..b34f938 100644..100755
--- a/webkit/glue/webpreferences.h
+++ b/webkit/glue/webpreferences.h
@@ -12,6 +12,7 @@
#define WEBKIT_GLUE_WEBPREFERENCES_H__
#include <string>
+#include <vector>
#include "googleurl/src/gurl.h"
namespace WebKit {
@@ -37,7 +38,9 @@ struct WebPreferences {
bool plugins_enabled;
bool dom_paste_enabled;
bool developer_extras_enabled;
- std::string inspector_settings;
+ typedef std::vector<std::pair<std::string, std::string> >
+ WebInspectorPreferences;
+ WebInspectorPreferences inspector_settings;
bool site_specific_quirks_enabled;
bool shrinks_standalone_images_to_fit;
bool uses_universal_detector;