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

Unified Diff: chrome/browser/ui/webui/ntp/new_tab_ui.cc

Issue 11348165: Remove PrefObserver usages, batch 10. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix android 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
Index: chrome/browser/ui/webui/ntp/new_tab_ui.cc
diff --git a/chrome/browser/ui/webui/ntp/new_tab_ui.cc b/chrome/browser/ui/webui/ntp/new_tab_ui.cc
index 9121a36fcf4ce96154ac1c563083e95915daf5ab..2aeb9afa19f9a4ff148b03efb94ed07c5e589a6c 100644
--- a/chrome/browser/ui/webui/ntp/new_tab_ui.cc
+++ b/chrome/browser/ui/webui/ntp/new_tab_ui.cc
@@ -164,7 +164,9 @@ NewTabUI::NewTabUI(content::WebUI* web_ui)
ChromeURLDataManager::AddDataSource(profile, html_source);
pref_change_registrar_.Init(GetProfile()->GetPrefs());
- pref_change_registrar_.Add(prefs::kShowBookmarkBar, this);
+ pref_change_registrar_.Add(prefs::kShowBookmarkBar,
+ base::Bind(&NewTabUI::OnShowBookmarkBarChanged,
+ base::Unretained(this)));
#if defined(ENABLE_THEMES)
// Listen for theme installation.
@@ -260,8 +262,7 @@ void NewTabUI::Observe(int type,
}
}
-void NewTabUI::OnPreferenceChanged(PrefServiceBase* service,
- const std::string& pref_name) {
+void NewTabUI::OnShowBookmarkBarChanged() {
StringValue attached(
GetProfile()->GetPrefs()->GetBoolean(prefs::kShowBookmarkBar) ?
"true" : "false");

Powered by Google App Engine
This is Rietveld 408576698