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

Unified Diff: chrome/browser/policy/cloud_policy_subsystem.cc

Issue 11345008: Remove content::NotificationObserver dependency from most Prefs code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments. Created 8 years, 2 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/policy/cloud_policy_subsystem.cc
diff --git a/chrome/browser/policy/cloud_policy_subsystem.cc b/chrome/browser/policy/cloud_policy_subsystem.cc
index bc51d6782aceffebc4751db6e536b4433186563a..a937508a6d86b5ac2f61b8a85021113f5cfc33d8 100644
--- a/chrome/browser/policy/cloud_policy_subsystem.cc
+++ b/chrome/browser/policy/cloud_policy_subsystem.cc
@@ -158,19 +158,12 @@ void CloudPolicySubsystem::UpdatePolicyRefreshRate(int64 refresh_rate) {
}
}
-void CloudPolicySubsystem::Observe(
- int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) {
- if (type == chrome::NOTIFICATION_PREF_CHANGED) {
- DCHECK_EQ(*(content::Details<std::string>(details).ptr()),
- std::string(refresh_pref_name_));
- PrefService* local_state = g_browser_process->local_state();
- DCHECK_EQ(content::Source<PrefService>(source).ptr(), local_state);
- UpdatePolicyRefreshRate(local_state->GetInteger(refresh_pref_name_));
- } else {
- NOTREACHED();
- }
+void CloudPolicySubsystem::OnPreferenceChanged(PrefServiceBase* service,
+ const std::string& pref_name) {
+ DCHECK_EQ(pref_name, refresh_pref_name_);
+ PrefService* local_state = g_browser_process->local_state();
+ DCHECK_EQ(service, local_state);
+ UpdatePolicyRefreshRate(local_state->GetInteger(refresh_pref_name_));
}
void CloudPolicySubsystem::ScheduleServiceInitialization(

Powered by Google App Engine
This is Rietveld 408576698