Index: chrome/browser/ui/content_settings/content_setting_bubble_model.cc |
diff --git a/chrome/browser/ui/content_settings/content_setting_bubble_model.cc b/chrome/browser/ui/content_settings/content_setting_bubble_model.cc |
index 0a03d05ad5f14ab38aa8f247ab791d484620f641..ab1da3c582ca265d3bd2e35355888e272e578d11 100644 |
--- a/chrome/browser/ui/content_settings/content_setting_bubble_model.cc |
+++ b/chrome/browser/ui/content_settings/content_setting_bubble_model.cc |
@@ -5,7 +5,9 @@ |
#include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" |
#include "base/command_line.h" |
+#include "base/macros.h" |
#include "base/prefs/pref_service.h" |
+#include "base/stl_util.h" |
#include "base/strings/utf_string_conversions.h" |
#include "chrome/browser/chrome_notification_types.h" |
#include "chrome/browser/content_settings/chrome_content_settings_utils.h" |
@@ -55,6 +57,22 @@ namespace { |
const int kAllowButtonIndex = 0; |
+// static |
+const ContentSettingsType kSupportedBubbleTypes[] = { |
+ CONTENT_SETTINGS_TYPE_COOKIES, |
+ CONTENT_SETTINGS_TYPE_IMAGES, |
+ CONTENT_SETTINGS_TYPE_JAVASCRIPT, |
+ CONTENT_SETTINGS_TYPE_PPAPI_BROKER, |
+ CONTENT_SETTINGS_TYPE_PLUGINS, |
+ CONTENT_SETTINGS_TYPE_POPUPS, |
+ CONTENT_SETTINGS_TYPE_GEOLOCATION, |
+ CONTENT_SETTINGS_TYPE_MIXEDSCRIPT, |
+ CONTENT_SETTINGS_TYPE_PROTOCOL_HANDLERS, |
+ CONTENT_SETTINGS_TYPE_MEDIASTREAM, |
+ CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS, |
+ CONTENT_SETTINGS_TYPE_MIDI_SYSEX, |
+}; |
+ |
// These states must match the order of appearance of the radio buttons |
// in the XIB file for the Mac port. |
enum RPHState { |
@@ -1264,12 +1282,23 @@ void ContentSettingMidiSysExBubbleModel::OnCustomLinkClicked() { |
} |
// static |
+const std::set<ContentSettingsType>& |
+ContentSettingBubbleModel::GetSupportedBubbleTypes() { |
+ CR_DEFINE_STATIC_LOCAL( |
+ const std::set<ContentSettingsType>, supported_bubble_types, |
+ (kSupportedBubbleTypes, |
+ kSupportedBubbleTypes + arraysize(kSupportedBubbleTypes))); |
+ return supported_bubble_types; |
+} |
+ |
+// static |
ContentSettingBubbleModel* |
ContentSettingBubbleModel::CreateContentSettingBubbleModel( |
Delegate* delegate, |
WebContents* web_contents, |
Profile* profile, |
ContentSettingsType content_type) { |
+ DCHECK(ContainsKey(GetSupportedBubbleTypes(), content_type)); |
if (content_type == CONTENT_SETTINGS_TYPE_COOKIES) { |
return new ContentSettingCookiesBubbleModel(delegate, web_contents, |
profile); |