Index: chrome/browser/extensions/api/content_settings/content_settings_api.cc |
diff --git a/chrome/browser/extensions/api/content_settings/content_settings_api.cc b/chrome/browser/extensions/api/content_settings/content_settings_api.cc |
index 0030797ab026950e9cab4f087aa0ec9dcef5816f..4d41984ed54b11e5b088e84f1d6e4c326dfb1c1a 100644 |
--- a/chrome/browser/extensions/api/content_settings/content_settings_api.cc |
+++ b/chrome/browser/extensions/api/content_settings/content_settings_api.cc |
@@ -25,6 +25,7 @@ |
#include "chrome/browser/profiles/profile.h" |
#include "chrome/common/chrome_switches.h" |
#include "chrome/common/extensions/api/content_settings.h" |
+#include "components/content_settings/core/browser/content_settings_utils.h" |
#include "components/content_settings/core/browser/cookie_settings.h" |
#include "components/content_settings/core/browser/host_content_settings_map.h" |
#include "content/public/browser/plugin_service.h" |
@@ -163,8 +164,10 @@ bool ContentSettingsContentSettingGetFunction::RunSync() { |
} |
base::DictionaryValue* result = new base::DictionaryValue(); |
- result->SetString(keys::kContentSettingKey, |
- helpers::ContentSettingToString(setting)); |
+ std::string setting_string = |
+ content_settings::ContentSettingToString(setting); |
+ DCHECK(!setting_string.empty()); |
+ result->SetString(keys::kContentSettingKey, setting_string); |
SetResult(result); |
@@ -208,7 +211,7 @@ bool ContentSettingsContentSettingSetFunction::RunSync() { |
params->details.setting->GetAsString(&setting_str)); |
ContentSetting setting; |
EXTENSION_FUNCTION_VALIDATE( |
- helpers::StringToContentSetting(setting_str, &setting)); |
+ content_settings::ContentSettingFromString(setting_str, &setting)); |
EXTENSION_FUNCTION_VALIDATE(HostContentSettingsMap::IsSettingAllowedForType( |
GetProfile()->GetPrefs(), setting, content_type)); |
@@ -240,7 +243,7 @@ bool ContentSettingsContentSettingSetFunction::RunSync() { |
error_ = base::StringPrintf( |
kUnsupportedDefaultSettingError, |
- content_settings_helpers::ContentSettingToString(setting), |
+ setting_str.c_str(), |
readable_type_name.c_str()); |
return false; |
} |