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

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

Issue 11414083: Remove PrefObserver usage, batch 9. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to sort-of good revision (r169014). 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 a937508a6d86b5ac2f61b8a85021113f5cfc33d8..272ac06300493148b0652904d242f55646ec35cd 100644
--- a/chrome/browser/policy/cloud_policy_subsystem.cc
+++ b/chrome/browser/policy/cloud_policy_subsystem.cc
@@ -103,7 +103,10 @@ void CloudPolicySubsystem::CompleteInitialization(
PrefService* local_state = g_browser_process->local_state();
DCHECK(pref_change_registrar_.IsEmpty());
pref_change_registrar_.Init(local_state);
- pref_change_registrar_.Add(refresh_pref_name_, this);
+ pref_change_registrar_.Add(
+ refresh_pref_name_,
+ base::Bind(&CloudPolicySubsystem::OnRefreshPrefChanged,
+ base::Unretained(this)));
UpdatePolicyRefreshRate(local_state->GetInteger(refresh_pref_name_));
}
}
@@ -158,11 +161,8 @@ void CloudPolicySubsystem::UpdatePolicyRefreshRate(int64 refresh_rate) {
}
}
-void CloudPolicySubsystem::OnPreferenceChanged(PrefServiceBase* service,
- const std::string& pref_name) {
- DCHECK_EQ(pref_name, refresh_pref_name_);
+void CloudPolicySubsystem::OnRefreshPrefChanged() {
PrefService* local_state = g_browser_process->local_state();
- DCHECK_EQ(service, local_state);
UpdatePolicyRefreshRate(local_state->GetInteger(refresh_pref_name_));
}
« 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