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

Unified Diff: chrome/browser/ui/gtk/browser_toolbar_gtk.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
« no previous file with comments | « chrome/browser/ui/gtk/browser_toolbar_gtk.h ('k') | chrome/browser/ui/gtk/browser_window_gtk.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/gtk/browser_toolbar_gtk.cc
diff --git a/chrome/browser/ui/gtk/browser_toolbar_gtk.cc b/chrome/browser/ui/gtk/browser_toolbar_gtk.cc
index d272e1e85cce0657fd6dc187a07a3ff3987b77d9..6919a51576e189bfc0f329aea1308789a43fde33 100644
--- a/chrome/browser/ui/gtk/browser_toolbar_gtk.cc
+++ b/chrome/browser/ui/gtk/browser_toolbar_gtk.cc
@@ -250,6 +250,7 @@ void BrowserToolbarGtk::Init(GtkWindow* top_level_window) {
if (actions_toolbar_->button_count() == 0)
gtk_widget_hide(actions_toolbar_->widget());
}
+
// Initialize pref-dependent UI state.
NotifyPrefChanged(NULL);
@@ -368,9 +369,7 @@ bool BrowserToolbarGtk::GetAcceleratorForCommandId(
void BrowserToolbarGtk::Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
- if (type == chrome::NOTIFICATION_PREF_CHANGED) {
- NotifyPrefChanged(content::Details<std::string>(details).ptr());
- } else if (type == chrome::NOTIFICATION_BROWSER_THEME_CHANGED) {
+ if (type == chrome::NOTIFICATION_BROWSER_THEME_CHANGED) {
// Update the spacing around the menu buttons
bool use_gtk = theme_service_->UsingNativeTheme();
int border = use_gtk ? 0 : 2;
@@ -426,6 +425,11 @@ void BrowserToolbarGtk::Observe(int type,
}
}
+void BrowserToolbarGtk::OnPreferenceChanged(PrefServiceBase* service,
+ const std::string& pref_name) {
+ NotifyPrefChanged(&pref_name);
+}
+
// BrowserToolbarGtk, public ---------------------------------------------------
void BrowserToolbarGtk::UpdateWebContents(WebContents* contents,
« no previous file with comments | « chrome/browser/ui/gtk/browser_toolbar_gtk.h ('k') | chrome/browser/ui/gtk/browser_window_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698