diff options
author | groby@chromium.org <groby@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-18 21:16:33 +0000 |
---|---|---|
committer | groby@chromium.org <groby@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-18 21:16:33 +0000 |
commit | a00ae1e67a8dc35d1ae4d1d36449447ec0f26cd7 (patch) | |
tree | 660be835e2a4460da61cff9651b0a32263a8d739 /chrome/browser/content_settings | |
parent | 3cfc69e6e0a882a2ad644df7623f07fce4579689 (diff) | |
download | chromium_src-a00ae1e67a8dc35d1ae4d1d36449447ec0f26cd7.zip chromium_src-a00ae1e67a8dc35d1ae4d1d36449447ec0f26cd7.tar.gz chromium_src-a00ae1e67a8dc35d1ae4d1d36449447ec0f26cd7.tar.bz2 |
Enable WebIntents blacklist UI (redo of #7645034)
BUG=ContentSettingBubbleControllerTest.Init
TEST=Run Chromium with -enable-web-intents, go to content settings/manage exceptions, see UI
Review URL: http://codereview.chromium.org/7670052
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97357 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/content_settings')
3 files changed, 16 insertions, 0 deletions
diff --git a/chrome/browser/content_settings/content_settings_pref_provider.cc b/chrome/browser/content_settings/content_settings_pref_provider.cc index a7f62fa..4a896b3 100644 --- a/chrome/browser/content_settings/content_settings_pref_provider.cc +++ b/chrome/browser/content_settings/content_settings_pref_provider.cc @@ -44,6 +44,7 @@ const char* kResourceTypeNames[] = { NULL, NULL, NULL, // Not used for Notifications + NULL, // Not used for Intents. }; COMPILE_ASSERT(arraysize(kResourceTypeNames) == CONTENT_SETTINGS_NUM_TYPES, resource_type_names_incorrect_size); @@ -57,6 +58,7 @@ const ContentSetting kDefaultSettings[] = { CONTENT_SETTING_BLOCK, // CONTENT_SETTINGS_TYPE_POPUPS CONTENT_SETTING_ASK, // CONTENT_SETTINGS_TYPE_GEOLOCATION CONTENT_SETTING_ASK, // CONTENT_SETTINGS_TYPE_NOTIFICATIONS + CONTENT_SETTING_ASK, // CONTENT_SETTINGS_TYPE_INTENTS }; COMPILE_ASSERT(arraysize(kDefaultSettings) == CONTENT_SETTINGS_NUM_TYPES, default_settings_incorrect_size); @@ -72,6 +74,7 @@ const char* kTypeNames[] = { // TODO(markusheintz): Refactoring in progress. Content settings exceptions // for notifications added next. "notifications", // Only used for default Notifications settings. + "intents", }; COMPILE_ASSERT(arraysize(kTypeNames) == CONTENT_SETTINGS_NUM_TYPES, type_names_incorrect_size); diff --git a/chrome/browser/content_settings/host_content_settings_map.cc b/chrome/browser/content_settings/host_content_settings_map.cc index 4bdb243..3d15073 100644 --- a/chrome/browser/content_settings/host_content_settings_map.cc +++ b/chrome/browser/content_settings/host_content_settings_map.cc @@ -407,6 +407,12 @@ void HostContentSettingsMap::ClearSettingsForOneType( // static bool HostContentSettingsMap::IsSettingAllowedForType( ContentSetting setting, ContentSettingsType content_type) { + // Intents content settings are hidden behind a switch for now. + if (content_type == CONTENT_SETTINGS_TYPE_INTENTS && + !CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableWebIntents)) + return false; + // DEFAULT, ALLOW and BLOCK are always allowed. if (setting == CONTENT_SETTING_DEFAULT || setting == CONTENT_SETTING_ALLOW || @@ -422,6 +428,7 @@ bool HostContentSettingsMap::IsSettingAllowedForType( switches::kEnableClickToPlay)); case CONTENT_SETTINGS_TYPE_GEOLOCATION: case CONTENT_SETTINGS_TYPE_NOTIFICATIONS: + case CONTENT_SETTINGS_TYPE_INTENTS: return (setting == CONTENT_SETTING_ASK); default: return false; diff --git a/chrome/browser/content_settings/host_content_settings_map_unittest.cc b/chrome/browser/content_settings/host_content_settings_map_unittest.cc index e78baa4..b2623fc 100644 --- a/chrome/browser/content_settings/host_content_settings_map_unittest.cc +++ b/chrome/browser/content_settings/host_content_settings_map_unittest.cc @@ -150,6 +150,8 @@ TEST_F(HostContentSettingsMapTest, IndividualSettings) { CONTENT_SETTING_ASK; desired_settings.settings[CONTENT_SETTINGS_TYPE_NOTIFICATIONS] = CONTENT_SETTING_ASK; + desired_settings.settings[CONTENT_SETTINGS_TYPE_INTENTS] = + CONTENT_SETTING_ASK; ContentSettings settings = host_content_settings_map->GetContentSettings(host, host); EXPECT_TRUE(SettingsEqual(desired_settings, settings)); @@ -596,6 +598,8 @@ TEST_F(HostContentSettingsMapTest, NestedSettings) { CONTENT_SETTING_ASK; desired_settings.settings[CONTENT_SETTINGS_TYPE_NOTIFICATIONS] = CONTENT_SETTING_ASK; + desired_settings.settings[CONTENT_SETTINGS_TYPE_INTENTS] = + CONTENT_SETTING_ASK; ContentSettings settings = host_content_settings_map->GetContentSettings(host, host); EXPECT_TRUE(SettingsEqual(desired_settings, settings)); @@ -611,6 +615,8 @@ TEST_F(HostContentSettingsMapTest, NestedSettings) { settings.settings[CONTENT_SETTINGS_TYPE_GEOLOCATION]); EXPECT_EQ(desired_settings.settings[CONTENT_SETTINGS_TYPE_COOKIES], settings.settings[CONTENT_SETTINGS_TYPE_COOKIES]); + EXPECT_EQ(desired_settings.settings[CONTENT_SETTINGS_TYPE_INTENTS], + settings.settings[CONTENT_SETTINGS_TYPE_INTENTS]); } TEST_F(HostContentSettingsMapTest, OffTheRecord) { |