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

Unified Diff: chrome/browser/ui/views/options/content_filter_page_view.cc

Issue 5398001: Allow default desktop content settings to be managed via policy (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove Cocoa UI-changes Created 10 years 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
« no previous file with comments | « chrome/browser/resources/options/content_settings.js ('k') | chrome/common/notification_type.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/options/content_filter_page_view.cc
diff --git a/chrome/browser/ui/views/options/content_filter_page_view.cc b/chrome/browser/ui/views/options/content_filter_page_view.cc
index d331540973c4a19b3a1ae1d9a89de741cbe8ff75..3e4ba8d8a6b30cf0dee6cb9da11beba583cd210f 100644
--- a/chrome/browser/ui/views/options/content_filter_page_view.cc
+++ b/chrome/browser/ui/views/options/content_filter_page_view.cc
@@ -153,6 +153,10 @@ void ContentFilterPageView::InitControlLayout() {
registrar_.Add(this, NotificationType::CONTENT_SETTINGS_CHANGED,
NotificationService::AllSources());
+ registrar_.Add(this, NotificationType::DESKTOP_NOTIFICATION_DEFAULT_CHANGED,
+ NotificationService::AllSources());
+ registrar_.Add(this, NotificationType::GEOLOCATION_SETTINGS_CHANGED,
+ NotificationService::AllSources());
}
///////////////////////////////////////////////////////////////////////////////
@@ -163,9 +167,13 @@ void ContentFilterPageView::UpdateView() {
if (content_type_ == CONTENT_SETTINGS_TYPE_GEOLOCATION) {
default_setting = profile()->GetGeolocationContentSettingsMap()->
GetDefaultContentSetting();
+ is_content_type_managed = profile()->GetGeolocationContentSettingsMap()->
+ IsDefaultContentSettingManaged();
} else if (content_type_ == CONTENT_SETTINGS_TYPE_NOTIFICATIONS) {
default_setting = profile()->GetDesktopNotificationService()->
GetDefaultContentSetting();
+ is_content_type_managed = profile()->GetDesktopNotificationService()->
+ IsDefaultContentSettingManaged();
} else {
default_setting = profile()->GetHostContentSettingsMap()->
GetDefaultContentSetting(content_type_);
@@ -267,6 +275,15 @@ void ContentFilterPageView::Observe(NotificationType type,
if (type == NotificationType::CONTENT_SETTINGS_CHANGED) {
NotifyContentSettingsChanged(
Details<ContentSettingsDetails>(details).ptr());
+ } else if (type == NotificationType::GEOLOCATION_SETTINGS_CHANGED) {
+ NotifyContentSettingsChanged(
+ Details<ContentSettingsDetails>(details).ptr());
+ } else if (type == NotificationType::DESKTOP_NOTIFICATION_DEFAULT_CHANGED) {
+ ContentSettingsDetails content_settings_details(
+ ContentSettingsPattern(),
+ CONTENT_SETTINGS_TYPE_NOTIFICATIONS,
+ "");
+ NotifyContentSettingsChanged(&content_settings_details);
} else {
OptionsPageBase::Observe(type, source, details);
}
« no previous file with comments | « chrome/browser/resources/options/content_settings.js ('k') | chrome/common/notification_type.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698