diff options
Diffstat (limited to 'chrome/browser/content_settings/content_settings_utils.cc')
-rw-r--r-- | chrome/browser/content_settings/content_settings_utils.cc | 61 |
1 files changed, 2 insertions, 59 deletions
diff --git a/chrome/browser/content_settings/content_settings_utils.cc b/chrome/browser/content_settings/content_settings_utils.cc index 66ec547..25b38cf 100644 --- a/chrome/browser/content_settings/content_settings_utils.cc +++ b/chrome/browser/content_settings/content_settings_utils.cc @@ -14,39 +14,6 @@ namespace { -// True if a given content settings type requires additional resource -// identifiers. -const bool kSupportsResourceIdentifier[CONTENT_SETTINGS_NUM_TYPES] = { - false, // CONTENT_SETTINGS_TYPE_COOKIES - false, // CONTENT_SETTINGS_TYPE_IMAGES - false, // CONTENT_SETTINGS_TYPE_JAVASCRIPT - true, // CONTENT_SETTINGS_TYPE_PLUGINS - false, // CONTENT_SETTINGS_TYPE_POPUPS - false, // CONTENT_SETTINGS_TYPE_GEOLOCATION - false, // CONTENT_SETTINGS_TYPE_NOTIFICATIONS - false, // CONTENT_SETTINGS_TYPE_INTENTS - false, // CONTENT_SETTINGS_TYPE_AUTO_SUBMIT_CERTIFICATE -}; -COMPILE_ASSERT(arraysize(kSupportsResourceIdentifier) == - CONTENT_SETTINGS_NUM_TYPES, - resource_type_names_incorrect_size); - -// The preference keys where resource identifiers are stored for -// ContentSettingsType values that support resource identifiers. -const char* kResourceTypeNames[] = { - NULL, - NULL, - NULL, - "per_plugin", - NULL, - NULL, - NULL, - NULL, - NULL, -}; -COMPILE_ASSERT(arraysize(kResourceTypeNames) == CONTENT_SETTINGS_NUM_TYPES, - resource_type_names_incorrect_size); - // The names of the ContentSettingsType values, for use with dictionary prefs. const char* kTypeNames[] = { "cookies", @@ -62,7 +29,7 @@ const char* kTypeNames[] = { COMPILE_ASSERT(arraysize(kTypeNames) == CONTENT_SETTINGS_NUM_TYPES, type_names_incorrect_size); -const char* kPatternSeparator = ","; +const char kPatternSeparator[] = ","; } // namespace @@ -72,32 +39,8 @@ std::string GetTypeName(ContentSettingsType type) { return std::string(kTypeNames[type]); } -std::string GetResourceTypeName(ContentSettingsType type) { - return std::string(kResourceTypeNames[type]); -} - -ContentSettingsType StringToContentSettingsType( - const std::string& content_type_str) { - for (size_t type = 0; type < arraysize(kTypeNames); ++type) { - if ((kTypeNames[type] != NULL) && (kTypeNames[type] == content_type_str)) - return ContentSettingsType(type); - } - for (size_t type = 0; type < arraysize(kResourceTypeNames); ++type) { - if ((kResourceTypeNames[type] != NULL) && - (kResourceTypeNames[type] == content_type_str)) { - return ContentSettingsType(type); - } - } - return CONTENT_SETTINGS_TYPE_DEFAULT; -} - bool SupportsResourceIdentifier(ContentSettingsType content_type) { - if (CommandLine::ForCurrentProcess()->HasSwitch( - switches::kEnableResourceContentSettings)) { - return kSupportsResourceIdentifier[content_type]; - } else { - return false; - } + return content_type == CONTENT_SETTINGS_TYPE_PLUGINS; } ContentSetting ClickToPlayFixup(ContentSettingsType content_type, |