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

Unified Diff: chrome/browser/content_setting_image_model.cc

Issue 2815042: Add notifications content settings type. (Closed)
Patch Set: '' Created 10 years, 6 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/content_setting_image_model.cc
diff --git a/chrome/browser/content_setting_image_model.cc b/chrome/browser/content_setting_image_model.cc
index 4745ec02c5cca0a2208574e77b02832c851cb81f..b1a0a53ab5709c9a6310aa8013593f31e413b3b3 100644
--- a/chrome/browser/content_setting_image_model.cc
+++ b/chrome/browser/content_setting_image_model.cc
@@ -28,6 +28,13 @@ class ContentSettingGeolocationImageModel : public ContentSettingImageModel {
virtual void UpdateFromTabContents(const TabContents* tab_contents);
};
+class ContentSettingNotificationsImageModel : public ContentSettingImageModel {
+ public:
+ ContentSettingNotificationsImageModel();
+
+ virtual void UpdateFromTabContents(const TabContents* tab_contents);
+};
+
const int ContentSettingBlockedImageModel::kBlockedIconIDs[] = {
IDR_BLOCKED_COOKIES,
IDR_BLOCKED_IMAGES,
@@ -93,6 +100,16 @@ void ContentSettingGeolocationImageModel::UpdateFromTabContents(
set_tooltip(l10n_util::GetStringUTF8(IDS_GEOLOCATION_BLOCKED_TOOLTIP));
}
+ContentSettingNotificationsImageModel::ContentSettingNotificationsImageModel()
+ : ContentSettingImageModel(CONTENT_SETTINGS_TYPE_NOTIFICATIONS) {
+}
+
+void ContentSettingNotificationsImageModel::UpdateFromTabContents(
+ const TabContents* tab_contents) {
+ // Notifications do not have a bubble.
+ set_visible(false);
+}
+
ContentSettingImageModel::ContentSettingImageModel(
ContentSettingsType content_settings_type)
: content_settings_type_(content_settings_type),
@@ -106,5 +123,7 @@ ContentSettingImageModel*
ContentSettingsType content_settings_type) {
if (content_settings_type == CONTENT_SETTINGS_TYPE_GEOLOCATION)
return new ContentSettingGeolocationImageModel();
+ if (content_settings_type == CONTENT_SETTINGS_TYPE_NOTIFICATIONS)
+ return new ContentSettingNotificationsImageModel();
return new ContentSettingBlockedImageModel(content_settings_type);
}
« no previous file with comments | « chrome/browser/content_setting_bubble_model.cc ('k') | chrome/browser/gtk/options/content_filter_page_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698