diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-07 00:37:53 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-07 00:37:53 +0000 |
commit | 7467340a80a0dce12fcaae5d5fc62ec56131b8bb (patch) | |
tree | 5a38c0636823a267369653500a96954b2e463103 /chrome/browser/gtk/browser_toolbar_gtk.h | |
parent | 3db3ff6a8ee531957ab460c5791243b4636d11e2 (diff) | |
download | chromium_src-7467340a80a0dce12fcaae5d5fc62ec56131b8bb.zip chromium_src-7467340a80a0dce12fcaae5d5fc62ec56131b8bb.tar.gz chromium_src-7467340a80a0dce12fcaae5d5fc62ec56131b8bb.tar.bz2 |
GTK: Use page and app menu models.
- implement more MenuModel support for MenuGtk
- copy some accelerators around
TODO: centralize accelerator list (currently they are all listed twice)
TODO: get rid of standard_menus.cc (it is still used by the popup favicon menu)
BUG=NONE
TEST=page and app menus still work, still display accelerators, accelerators still work
Review URL: http://codereview.chromium.org/523105
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35671 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/browser_toolbar_gtk.h')
-rw-r--r-- | chrome/browser/gtk/browser_toolbar_gtk.h | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/chrome/browser/gtk/browser_toolbar_gtk.h b/chrome/browser/gtk/browser_toolbar_gtk.h index 5a769fc..73ffd74 100644 --- a/chrome/browser/gtk/browser_toolbar_gtk.h +++ b/chrome/browser/gtk/browser_toolbar_gtk.h @@ -8,11 +8,14 @@ #include <gtk/gtk.h> #include <string> +#include "app/menus/simple_menu_model.h" #include "base/scoped_ptr.h" +#include "chrome/browser/app_menu_model.h" #include "chrome/browser/bubble_positioner.h" #include "chrome/browser/command_updater.h" #include "chrome/browser/gtk/menu_bar_helper.h" #include "chrome/browser/gtk/menu_gtk.h" +#include "chrome/browser/page_menu_model.h" #include "chrome/browser/sync/profile_sync_service.h" #include "chrome/common/notification_observer.h" #include "chrome/common/notification_registrar.h" @@ -37,6 +40,7 @@ class ToolbarStarToggleGtk; // events back to the Browser. class BrowserToolbarGtk : public CommandUpdater::CommandObserver, public ProfileSyncServiceObserver, + public menus::SimpleMenuModel::Delegate, public MenuGtk::Delegate, public NotificationObserver, public BubblePositioner, @@ -77,11 +81,15 @@ class BrowserToolbarGtk : public CommandUpdater::CommandObserver, virtual void EnabledStateChangedForCommand(int id, bool enabled); // Overridden from MenuGtk::Delegate: - virtual bool IsCommandEnabled(int command_id) const; - virtual bool IsItemChecked(int id) const; - virtual void ExecuteCommand(int command_id); virtual void StoppedShowing(); + // Overridden from menus::SimpleMenuModel::Delegate: + virtual bool IsCommandIdEnabled(int id) const; + virtual bool IsCommandIdChecked(int id) const; + virtual void ExecuteCommand(int id); + virtual bool GetAcceleratorForCommandId(int id, + menus::Accelerator* accelerator); + // NotificationObserver implementation. void Observe(NotificationType type, const NotificationSource& source, @@ -183,9 +191,6 @@ class BrowserToolbarGtk : public CommandUpdater::CommandObserver, // The location bar view. scoped_ptr<LocationBarViewGtk> location_bar_; - // A pointer to our window's accelerator list. - GtkAccelGroup* accel_group_; - // All the buttons in the toolbar. scoped_ptr<BackForwardButtonGtk> back_, forward_; scoped_ptr<CustomDrawButton> reload_; @@ -208,6 +213,9 @@ class BrowserToolbarGtk : public CommandUpdater::CommandObserver, scoped_ptr<MenuGtk> page_menu_; scoped_ptr<MenuGtk> app_menu_; + PageMenuModel page_menu_model_; + AppMenuModel app_menu_model_; + Browser* browser_; BrowserWindowGtk* window_; Profile* profile_; |