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

Unified Diff: chrome/browser/ui/gtk/global_menu_bar.cc

Issue 10677009: Move command handling and updating off Browser and onto a helper object. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 6 months 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/global_menu_bar.h ('k') | chrome/browser/ui/gtk/location_bar_view_gtk.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/gtk/global_menu_bar.cc
===================================================================
--- chrome/browser/ui/gtk/global_menu_bar.cc (revision 144460)
+++ chrome/browser/ui/gtk/global_menu_bar.cc (working copy)
@@ -11,6 +11,7 @@
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/gtk/accelerators_gtk.h"
#include "chrome/browser/ui/gtk/gtk_theme_service.h"
#include "chrome/browser/ui/gtk/gtk_util.h"
@@ -169,9 +170,8 @@
for (CommandIDMenuItemMap::const_iterator it = id_to_menu_item_.begin();
it != id_to_menu_item_.end(); ++it) {
// Get the starting enabled state.
- gtk_widget_set_sensitive(
- it->second,
- browser_->command_updater()->IsCommandEnabled(it->first));
+ gtk_widget_set_sensitive(it->second,
+ chrome::IsCommandEnabled(browser_, it->first));
// Set the accelerator for each menu item.
AcceleratorsGtk* accelerators = AcceleratorsGtk::GetInstance();
@@ -186,7 +186,7 @@
GTK_ACCEL_VISIBLE);
}
- browser_->command_updater()->AddCommandObserver(it->first, this);
+ chrome::AddCommandObserver(browser_, it->first, this);
}
pref_change_registrar_.Init(browser_->profile()->GetPrefs());
@@ -202,7 +202,7 @@
void GlobalMenuBar::Disable() {
for (CommandIDMenuItemMap::const_iterator it = id_to_menu_item_.begin();
it != id_to_menu_item_.end(); ++it) {
- browser_->command_updater()->RemoveCommandObserver(it->first, this);
+ chrome::RemoveCommandObserver(browser_, it->first, this);
}
id_to_menu_item_.clear();
@@ -308,5 +308,5 @@
return;
int id = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(sender), "command-id"));
- browser_->ExecuteCommandIfEnabled(id);
+ chrome::ExecuteCommand(browser_, id);
}
« no previous file with comments | « chrome/browser/ui/gtk/global_menu_bar.h ('k') | chrome/browser/ui/gtk/location_bar_view_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698