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

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: 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
« no previous file with comments | « chrome/browser/policy/cloud_policy_subsystem.h ('k') | chrome/browser/policy/url_blacklist_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « chrome/browser/policy/cloud_policy_subsystem.h ('k') | chrome/browser/policy/url_blacklist_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698