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

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

Issue 11345008: Remove content::NotificationObserver dependency from most Prefs code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head for commit 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 31076d13b6af5d8a4ee97d9fb95bc397bb40f7cc..7f91d3f070787f22b800dcf15da894ce5ab21c7f 100644
--- a/chrome/browser/ui/views/toolbar_view.cc
+++ b/chrome/browser/ui/views/toolbar_view.cc
@@ -528,14 +528,6 @@ void ToolbarView::Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
switch (type) {
- case chrome::NOTIFICATION_PREF_CHANGED: {
- std::string* pref_name = content::Details<std::string>(details).ptr();
- if (*pref_name == prefs::kShowHomeButton) {
- Layout();
- SchedulePaint();
- }
- break;
- }
case chrome::NOTIFICATION_UPGRADE_RECOMMENDED:
case chrome::NOTIFICATION_MODULE_INCOMPATIBILITY_BADGE_CHANGE:
case chrome::NOTIFICATION_GLOBAL_ERRORS_CHANGED:
@@ -551,6 +543,14 @@ 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:
« no previous file with comments | « chrome/browser/ui/views/toolbar_view.h ('k') | chrome/browser/ui/webui/extensions/extension_settings_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698