summaryrefslogtreecommitdiffstats
path: root/chrome/browser/tab_contents
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 /chrome/browser/tab_contents
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
Diffstat (limited to 'chrome/browser/tab_contents')
-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
3 files changed, 20 insertions, 8 deletions
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();