diff options
author | danno@chromium.org <danno@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-22 13:47:59 +0000 |
---|---|---|
committer | danno@chromium.org <danno@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-22 13:47:59 +0000 |
commit | 2510323ec78d771c9258fa95d8f98b5d18f3efaa (patch) | |
tree | 2bbb6a5c3ebba6adf5f01982c75ba52275aadcc4 /chrome/browser/tab_contents | |
parent | 37d5293518a8657af4d79035f7ef2e8c3a8d6b9a (diff) | |
download | chromium_src-2510323ec78d771c9258fa95d8f98b5d18f3efaa.zip chromium_src-2510323ec78d771c9258fa95d8f98b5d18f3efaa.tar.gz chromium_src-2510323ec78d771c9258fa95d8f98b5d18f3efaa.tar.bz2 |
Revert 60169 - Use PrefChangeRegistrar everywhere
BUG=54955
TEST=PrefChangeRegistrarTest.*
Review URL: http://codereview.chromium.org/3304015
TBR=danno@chromium.org
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60170 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents')
-rw-r--r-- | chrome/browser/tab_contents/tab_contents.cc | 11 | ||||
-rw-r--r-- | chrome/browser/tab_contents/tab_contents.h | 4 |
2 files changed, 8 insertions, 7 deletions
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc index 8ed1017..5edfb32 100644 --- a/chrome/browser/tab_contents/tab_contents.cc +++ b/chrome/browser/tab_contents/tab_contents.cc @@ -399,10 +399,9 @@ TabContents::TabContents(Profile* profile, // Register for notifications about all interested prefs change. PrefService* prefs = profile->GetPrefs(); - pref_change_registrar_.Init(prefs); if (prefs) { for (int i = 0; i < kPrefsToObserveLength; ++i) - pref_change_registrar_.Add(kPrefsToObserve[i], this); + prefs->AddPrefObserver(kPrefsToObserve[i], this); } // Register for notifications about URL starredness changing on any profile. @@ -442,7 +441,13 @@ TabContents::~TabContents() { // We don't want any notifications while we're running our destructor. registrar_.RemoveAll(); - pref_change_registrar_.RemoveAll(); + + // Unregister the notifications of all observed prefs change. + PrefService* prefs = profile()->GetPrefs(); + if (prefs) { + for (int i = 0; i < kPrefsToObserveLength; ++i) + prefs->RemovePrefObserver(kPrefsToObserve[i], this); + } NotifyDisconnected(); hung_renderer_dialog::HideForTabContents(this); diff --git a/chrome/browser/tab_contents/tab_contents.h b/chrome/browser/tab_contents/tab_contents.h index d37aab8..90ded2e 100644 --- a/chrome/browser/tab_contents/tab_contents.h +++ b/chrome/browser/tab_contents/tab_contents.h @@ -24,7 +24,6 @@ #include "chrome/browser/find_bar_controller.h" #include "chrome/browser/find_notification_details.h" #include "chrome/browser/jsmessage_box_client.h" -#include "chrome/browser/prefs/pref_change_registrar.h" #include "chrome/browser/password_manager/password_manager_delegate.h" #include "chrome/browser/renderer_host/render_view_host_delegate.h" #include "chrome/browser/tab_contents/constrained_window.h" @@ -1058,9 +1057,6 @@ class TabContents : public PageNavigator, // Registers and unregisters us for notifications. NotificationRegistrar registrar_; - // Registers and unregisters for pref notifications. - PrefChangeRegistrar pref_change_registrar_; - // Handles print preview and print job for this contents. scoped_ptr<printing::PrintViewManager> printing_; |