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

Unified Diff: chrome/browser/ui/browser_instant_controller.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/ui/browser_instant_controller.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: 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 96c2755ec3a3003e50fb3ac3ef52e17807a39cb1..e8f9dba81dfd1b3bd55a267800a09c737ce6d178 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()));
}
« no previous file with comments | « chrome/browser/ui/browser_instant_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698