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

Unified Diff: chrome/browser/extensions/api/content_settings/content_settings_store.cc

Issue 1372353004: Making structure for ContentSettings and its corresponding strings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing nits. Created 5 years, 2 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: chrome/browser/extensions/api/content_settings/content_settings_store.cc
diff --git a/chrome/browser/extensions/api/content_settings/content_settings_store.cc b/chrome/browser/extensions/api/content_settings/content_settings_store.cc
index c81a38458fbc4d320be38a72a1988919be9dbd6a..523203d6fb241c61aa7f04b810cb574b3edbd07e 100644
--- a/chrome/browser/extensions/api/content_settings/content_settings_store.cc
+++ b/chrome/browser/extensions/api/content_settings/content_settings_store.cc
@@ -271,9 +271,12 @@ base::ListValue* ContentSettingsStore::GetSettingsForExtension(
it->first.resource_identifier);
ContentSetting content_setting = ValueToContentSetting(rule.value.get());
DCHECK_NE(CONTENT_SETTING_DEFAULT, content_setting);
- setting_dict->SetString(
- keys::kContentSettingKey,
- helpers::ContentSettingToString(content_setting));
+
+ std::string setting_string =
+ content_settings::ContentSettingToString(content_setting);
+ DCHECK(!setting_string.empty());
+
+ setting_dict->SetString(keys::kContentSettingKey, setting_string);
settings->Append(setting_dict);
}
}
@@ -314,9 +317,9 @@ void ContentSettingsStore::SetExtensionContentSettingFromList(
std::string content_setting_string;
dict->GetString(keys::kContentSettingKey, &content_setting_string);
- ContentSetting setting = CONTENT_SETTING_DEFAULT;
- bool result =
- helpers::StringToContentSetting(content_setting_string, &setting);
+ ContentSetting setting;
+ bool result = content_settings::ContentSettingFromString(
+ content_setting_string, &setting);
DCHECK(result);
SetExtensionContentSetting(extension_id,

Powered by Google App Engine
This is Rietveld 408576698