Chromium Code Reviews| Index: chrome/browser/content_settings/content_settings_pref_provider.cc |
| diff --git a/chrome/browser/content_settings/content_settings_pref_provider.cc b/chrome/browser/content_settings/content_settings_pref_provider.cc |
| index d185dcddf73b178e5a3a794706c5a39e125fff24..d19fdb3d9489071bc18d2994ef27d89ba87643a4 100644 |
| --- a/chrome/browser/content_settings/content_settings_pref_provider.cc |
| +++ b/chrome/browser/content_settings/content_settings_pref_provider.cc |
| @@ -14,6 +14,7 @@ |
| #include "base/metrics/histogram.h" |
| #include "chrome/browser/content_settings/content_settings_rule.h" |
| #include "chrome/browser/content_settings/content_settings_utils.h" |
| +#include "chrome/browser/content_settings/host_content_settings_map.h" |
| #include "chrome/browser/prefs/pref_service.h" |
| #include "chrome/browser/prefs/scoped_user_pref_update.h" |
| #include "chrome/common/chrome_notification_types.h" |
| @@ -361,17 +362,33 @@ void PrefProvider::ReadContentSettingsFromPref(bool overwrite) { |
| } |
| } |
| } |
| - int setting = CONTENT_SETTING_DEFAULT; |
| - if (settings_dictionary->GetIntegerWithoutPathExpansion( |
| - GetTypeName(ContentSettingsType(i)), &setting)) { |
| - DCHECK_NE(CONTENT_SETTING_DEFAULT, setting); |
| - setting = FixObsoleteCookiePromptMode(content_type, |
| - ContentSetting(setting)); |
| + Value* value = NULL; |
| + if (HostContentSettingsMap::ContentTypeHasCompoundValue(content_type)) { |
| + DictionaryValue* setting = NULL; |
|
no longer working on chromium
2012/06/20 17:24:38
To joaodasilva: Thanks for pointing out, I was not
|
| + // TODO(xians): Handle the non-dictionary types. |
| + if (settings_dictionary->GetDictionaryWithoutPathExpansion( |
| + GetTypeName(ContentSettingsType(i)), &setting)) { |
| + DCHECK(!setting->empty()); |
|
no longer working on chromium
2012/06/20 17:24:38
To bauerb: I am a bit not sure if we should allow
Bernhard Bauer
2012/06/20 18:33:27
That's fine with me, my point was that we should d
|
| + value = setting->DeepCopy(); |
| + } |
| + } else { |
| + int setting = CONTENT_SETTING_DEFAULT; |
| + if (settings_dictionary->GetIntegerWithoutPathExpansion( |
| + GetTypeName(ContentSettingsType(i)), &setting)) { |
| + DCHECK_NE(CONTENT_SETTING_DEFAULT, setting); |
| + setting = FixObsoleteCookiePromptMode(content_type, |
| + ContentSetting(setting)); |
| + value = Value::CreateIntegerValue(setting); |
| + } |
| + } |
| + |
| + // |value_map_| will take the ownership of |value|. |
| + if (value != NULL) { |
| value_map_.SetValue(pattern_pair.first, |
| pattern_pair.second, |
| content_type, |
| ResourceIdentifier(""), |
| - Value::CreateIntegerValue(setting)); |
| + value); |
| } |
| } |
| } |