diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-23 23:18:50 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-23 23:18:50 +0000 |
commit | 4232100ca0d42e558e75a728b69abca4b28499bf (patch) | |
tree | e736db46d06de1f65d6aa92ccc119ab067927770 /chrome/browser/gtk/browser_toolbar_gtk.cc | |
parent | 7303999ef7654bbb633e901717fedcc31afca4fe (diff) | |
download | chromium_src-4232100ca0d42e558e75a728b69abca4b28499bf.zip chromium_src-4232100ca0d42e558e75a728b69abca4b28499bf.tar.gz chromium_src-4232100ca0d42e558e75a728b69abca4b28499bf.tar.bz2 |
Clean up the WrenchMenuModel so that it uses SimpleMenu::Delegate.
This removes copy-pasted code in each platform implementation.
BUG=47320
TEST=compiles
Review URL: http://codereview.chromium.org/3163023
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57119 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/browser_toolbar_gtk.cc')
-rw-r--r-- | chrome/browser/gtk/browser_toolbar_gtk.cc | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/chrome/browser/gtk/browser_toolbar_gtk.cc b/chrome/browser/gtk/browser_toolbar_gtk.cc index a28abed..2d8562a 100644 --- a/chrome/browser/gtk/browser_toolbar_gtk.cc +++ b/chrome/browser/gtk/browser_toolbar_gtk.cc @@ -227,7 +227,7 @@ void BrowserToolbarGtk::Init(Profile* profile, gtk_container_add(GTK_CONTAINER(wrench_box), wrench_button); gtk_box_pack_start(GTK_BOX(toolbar_), wrench_box, FALSE, FALSE, 4); - wrench_menu_.reset(new MenuGtk(this, &wrench_menu_model_)); + wrench_menu_.reset(new MenuGtk(this, wrench_menu_model_.menu_model())); g_signal_connect(wrench_menu_->widget(), "show", G_CALLBACK(OnWrenchMenuShowThunk), this); @@ -333,33 +333,7 @@ GtkIconSet* BrowserToolbarGtk::GetIconSetForId(int idr) { return theme_provider_->GetIconSetForId(idr); } -// menus::SimpleMenuModel::Delegate - -bool BrowserToolbarGtk::IsCommandIdEnabled(int id) const { - return browser_->command_updater()->IsCommandEnabled(id); -} - -bool BrowserToolbarGtk::IsCommandIdChecked(int id) const { - if (!profile_) - return false; - - EncodingMenuController controller; - if (id == IDC_SHOW_BOOKMARK_BAR) { - return profile_->GetPrefs()->GetBoolean(prefs::kShowBookmarkBar); - } else if (controller.DoesCommandBelongToEncodingMenu(id)) { - TabContents* tab_contents = browser_->GetSelectedTabContents(); - if (tab_contents) { - return controller.IsItemChecked(profile_, tab_contents->encoding(), - id); - } - } - - return false; -} - -void BrowserToolbarGtk::ExecuteCommand(int id) { - browser_->ExecuteCommand(id); -} +// menus::AcceleratorProvider bool BrowserToolbarGtk::GetAcceleratorForCommandId( int id, |