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

Unified Diff: chrome/browser/host_zoom_map.cc

Issue 3304015: Use PrefChangeRegistrar everywhere (Closed)
Patch Set: final version for commit Created 10 years, 3 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
« no previous file with comments | « chrome/browser/host_zoom_map.h ('k') | chrome/browser/host_zoom_map_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/host_zoom_map.cc
diff --git a/chrome/browser/host_zoom_map.cc b/chrome/browser/host_zoom_map.cc
index 0c1d96a22c998f0f2a22f7a90dd60dc92130e489..cb67a04477ab33e2f39a42d3c6259553aa37bc9e 100644
--- a/chrome/browser/host_zoom_map.cc
+++ b/chrome/browser/host_zoom_map.cc
@@ -27,8 +27,10 @@ HostZoomMap::HostZoomMap(Profile* profile)
// Don't observe pref changes (e.g. from sync) in Incognito; once we create
// the incognito window it should have no further connection to the main
// profile/prefs.
- if (!profile_->IsOffTheRecord())
- profile_->GetPrefs()->AddPrefObserver(prefs::kPerHostZoomLevels, this);
+ if (!profile_->IsOffTheRecord()) {
+ pref_change_registrar_.Init(profile_->GetPrefs());
+ pref_change_registrar_.Add(prefs::kPerHostZoomLevels, this);
+ }
}
void HostZoomMap::Load() {
@@ -128,7 +130,7 @@ void HostZoomMap::Shutdown() {
NotificationType::PROFILE_DESTROYED,
Source<Profile>(profile_));
if (!profile_->IsOffTheRecord())
- profile_->GetPrefs()->RemovePrefObserver(prefs::kPerHostZoomLevels, this);
+ pref_change_registrar_.RemoveAll();
profile_ = NULL;
}
« no previous file with comments | « chrome/browser/host_zoom_map.h ('k') | chrome/browser/host_zoom_map_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698