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

Unified Diff: components/content_settings/core/browser/content_settings_pref.cc

Issue 1318083005: Remove HostContentSettingsMap::ContentTypeHasCompoundValue function (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove-num-types-enum-3
Patch Set: Created 5 years, 3 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: components/content_settings/core/browser/content_settings_pref.cc
diff --git a/components/content_settings/core/browser/content_settings_pref.cc b/components/content_settings/core/browser/content_settings_pref.cc
index 2443e274884a5d20d0885f4c553dc5730dceb2e9..7cf4a3287cf2c6d3fda6e58d3628364e4746c6e8 100644
--- a/components/content_settings/core/browser/content_settings_pref.cc
+++ b/components/content_settings/core/browser/content_settings_pref.cc
@@ -11,6 +11,7 @@
#include "base/prefs/scoped_user_pref_update.h"
#include "base/strings/string_split.h"
#include "base/time/clock.h"
+#include "components/content_settings/core/browser/content_settings_registry.h"
#include "components/content_settings/core/browser/content_settings_rule.h"
#include "components/content_settings/core/browser/content_settings_utils.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
@@ -308,15 +309,7 @@ void ContentSettingsPref::ReadContentSettingsFromPref() {
}
}
base::Value* value = NULL;
- if (HostContentSettingsMap::ContentTypeHasCompoundValue(content_type_)) {
- const base::DictionaryValue* setting = NULL;
- // TODO(xians): Handle the non-dictionary types.
- if (settings_dictionary->GetDictionaryWithoutPathExpansion(
- kSettingPath, &setting)) {
- DCHECK(!setting->empty());
- value = setting->DeepCopy();
- }
- } else {
+ if (ContentSettingsRegistry::GetInstance()->Get(content_type_)) {
int setting = CONTENT_SETTING_DEFAULT;
if (settings_dictionary->GetIntegerWithoutPathExpansion(
kSettingPath, &setting)) {
@@ -325,6 +318,14 @@ void ContentSettingsPref::ReadContentSettingsFromPref() {
ContentSetting(setting));
value = new base::FundamentalValue(setting);
}
+ } else {
+ const base::DictionaryValue* setting = NULL;
+ // TODO(xians): Handle the non-dictionary types.
+ if (settings_dictionary->GetDictionaryWithoutPathExpansion(kSettingPath,
+ &setting)) {
+ DCHECK(!setting->empty());
+ value = setting->DeepCopy();
+ }
}
if (value != NULL) {

Powered by Google App Engine
This is Rietveld 408576698