From 0b3fa50cd4eb5b1ba6a8820bcc352ef6876ba9e9 Mon Sep 17 00:00:00 2001 From: "joi@chromium.org" Date: Wed, 21 Nov 2012 13:57:46 +0000 Subject: Remove PrefObserver usage, batch 9. TBR=abodenha@chromium.org,erikkay@chromium.org,erikwright@chromium.org,erg@chromium.org,ben@chromium.org,xiyuan@chromium.org BUG=155525 Review URL: https://chromiumcodereview.appspot.com/11414083 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@169029 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/ui/browser_instant_controller.cc | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'chrome/browser/ui/browser_instant_controller.cc') diff --git a/chrome/browser/ui/browser_instant_controller.cc b/chrome/browser/ui/browser_instant_controller.cc index 96c2755..e8f9dba 100644 --- a/chrome/browser/ui/browser_instant_controller.cc +++ b/chrome/browser/ui/browser_instant_controller.cc @@ -42,8 +42,11 @@ BrowserInstantController::BrowserInstantController(Browser* browser) initialized_theme_info_(false), theme_area_height_(0) { profile_pref_registrar_.Init(browser_->profile()->GetPrefs()); - profile_pref_registrar_.Add(prefs::kInstantEnabled, this); - instant_.SetInstantEnabled(IsInstantEnabled(browser_->profile())); + profile_pref_registrar_.Add( + prefs::kInstantEnabled, + base::Bind(&BrowserInstantController::ResetInstant, + base::Unretained(this))); + ResetInstant(); browser_->search_model()->AddObserver(this); #if defined(ENABLE_THEMES) @@ -148,12 +151,7 @@ void BrowserInstantController::UpdateThemeInfoForPreview() { OnThemeChanged(NULL); } -//////////////////////////////////////////////////////////////////////////////// -// BrowserInstantController, PrefObserver implementation: - -void BrowserInstantController::OnPreferenceChanged( - PrefServiceBase* service, - const std::string& pref_name) { +void BrowserInstantController::ResetInstant() { instant_.SetInstantEnabled(IsInstantEnabled(browser_->profile())); } -- cgit v1.1