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

Unified Diff: chrome/browser/ui/views/toolbar_view.cc

Issue 11348165: Remove PrefObserver usages, batch 10. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/views/toolbar_view.cc
diff --git a/chrome/browser/ui/views/toolbar_view.cc b/chrome/browser/ui/views/toolbar_view.cc
index 6e70d77f782764a10c637b5d8aa031f2595788c4..cdd336bc0ce3308264d3effb815a3470fb390f8d 100644
--- a/chrome/browser/ui/views/toolbar_view.cc
+++ b/chrome/browser/ui/views/toolbar_view.cc
@@ -287,7 +287,9 @@ void ToolbarView::Init() {
location_bar_->Init();
show_home_button_.Init(prefs::kShowHomeButton,
- browser_->profile()->GetPrefs(), this);
+ browser_->profile()->GetPrefs(),
+ base::Bind(&ToolbarView::OnShowHomeButtonChanged,
+ base::Unretained(this)));
browser_actions_->Init();
@@ -558,14 +560,6 @@ void ToolbarView::Observe(int type,
}
}
-void ToolbarView::OnPreferenceChanged(PrefServiceBase* service,
- const std::string& pref_name) {
- if (pref_name == prefs::kShowHomeButton) {
- Layout();
- SchedulePaint();
- }
-}
-
////////////////////////////////////////////////////////////////////////////////
// ToolbarView, ui::AcceleratorProvider implementation:
@@ -910,3 +904,8 @@ void ToolbarView::UpdateAppMenuState() {
app_menu_->SetPushedIcon(GetAppMenuIcon(views::CustomButton::STATE_PRESSED));
SchedulePaint();
}
+
+void ToolbarView::OnShowHomeButtonChanged() {
+ Layout();
+ SchedulePaint();
+}

Powered by Google App Engine
This is Rietveld 408576698