diff options
author | danno@chromium.org <danno@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-29 12:24:28 +0000 |
---|---|---|
committer | danno@chromium.org <danno@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-29 12:24:28 +0000 |
commit | 2fb7dc983456e980d631501f4a120eb091d197e7 (patch) | |
tree | fa96aef59bf1900f56ae1b0457c4f9d36e0fb38e /chrome/browser/host_zoom_map.cc | |
parent | 0ce04e5a148136f3849e8a8b0dd351a0fc4798b5 (diff) | |
download | chromium_src-2fb7dc983456e980d631501f4a120eb091d197e7.zip chromium_src-2fb7dc983456e980d631501f4a120eb091d197e7.tar.gz chromium_src-2fb7dc983456e980d631501f4a120eb091d197e7.tar.bz2 |
Use PrefChangeRegistrar everywhere
BUG=54955
TEST=PrefChangeRegistrarTest.*
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=60169
Review URL: http://codereview.chromium.org/3304015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60935 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/host_zoom_map.cc')
-rw-r--r-- | chrome/browser/host_zoom_map.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/chrome/browser/host_zoom_map.cc b/chrome/browser/host_zoom_map.cc index 0c1d96a..cb67a04 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; } |