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

Unified Diff: chrome/browser/content_settings/content_settings_policy_provider.cc

Issue 11345008: Remove content::NotificationObserver dependency from most Prefs code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head for commit Created 8 years, 1 month 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_settings/content_settings_policy_provider.cc
diff --git a/chrome/browser/content_settings/content_settings_policy_provider.cc b/chrome/browser/content_settings/content_settings_policy_provider.cc
index cb24bfd20480c02e37d3a77575e82eae466dcd10..0160b510cd9f619c52b41a9871d7b21a3dc07899 100644
--- a/chrome/browser/content_settings/content_settings_policy_provider.cc
+++ b/chrome/browser/content_settings/content_settings_policy_provider.cc
@@ -422,14 +422,11 @@ void PolicyProvider::ShutdownOnUIThread() {
prefs_ = NULL;
}
-void PolicyProvider::Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) {
+void PolicyProvider::OnPreferenceChanged(PrefServiceBase* service,
+ const std::string& name) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- DCHECK_EQ(chrome::NOTIFICATION_PREF_CHANGED, type);
- DCHECK_EQ(content::Source<PrefService>(source).ptr(), prefs_);
+ DCHECK_EQ(prefs_, service);
- const std::string& name = *content::Details<std::string>(details).ptr();
if (name == prefs::kManagedDefaultCookiesSetting) {
UpdateManagedDefaultSetting(CONTENT_SETTINGS_TYPE_COOKIES);
} else if (name == prefs::kManagedDefaultImagesSetting) {
@@ -462,10 +459,8 @@ void PolicyProvider::Observe(int type,
name == prefs::kManagedNotificationsBlockedForUrls) {
ReadManagedContentSettings(true);
ReadManagedDefaultSettings();
- } else {
- NOTREACHED();
- return;
}
+
NotifyObservers(ContentSettingsPattern(),
ContentSettingsPattern(),
CONTENT_SETTINGS_TYPE_DEFAULT,

Powered by Google App Engine
This is Rietveld 408576698