summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/browser_titlebar.h
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-19 17:52:42 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-19 17:52:42 +0000
commit4762a9ed08ec93918b58269c21f78df72bc4961e (patch)
tree54d16d9220f4d075e14f9f2e5e32fbc4470c4d3d /chrome/browser/gtk/browser_titlebar.h
parent0137991d3c78ec95d6d7fc386ae151d4359b308c (diff)
downloadchromium_src-4762a9ed08ec93918b58269c21f78df72bc4961e.zip
chromium_src-4762a9ed08ec93918b58269c21f78df72bc4961e.tar.gz
chromium_src-4762a9ed08ec93918b58269c21f78df72bc4961e.tar.bz2
Make a MenuModel for the popup favicon menu. For now only GTK uses it. Consolidate all accelerators for browser commands into one place.
BUG=28212,27535 TEST=1. enable custom frame and a popup window and test that the popup contains all the same (non-system) menu items as windows. 2. all context menus still display the correct shortcuts and the shortcuts work Review URL: http://codereview.chromium.org/551032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36527 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/browser_titlebar.h')
-rw-r--r--chrome/browser/gtk/browser_titlebar.h31
1 files changed, 21 insertions, 10 deletions
diff --git a/chrome/browser/gtk/browser_titlebar.h b/chrome/browser/gtk/browser_titlebar.h
index fe468ec..5c09692 100644
--- a/chrome/browser/gtk/browser_titlebar.h
+++ b/chrome/browser/gtk/browser_titlebar.h
@@ -13,19 +13,21 @@
#include <gtk/gtk.h>
#include "app/active_window_watcher_x.h"
+#include "app/menus/simple_menu_model.h"
#include "base/scoped_ptr.h"
-#include "chrome/browser/gtk/menu_gtk.h"
#include "chrome/common/notification_observer.h"
#include "chrome/common/notification_registrar.h"
class BrowserWindowGtk;
class CustomDrawButton;
class GtkThemeProvider;
+class MenuGtk;
+class PopupPageMenuModel;
class TabContents;
-class BrowserTitlebar : public MenuGtk::Delegate,
- public NotificationObserver,
- public ActiveWindowWatcherX::Observer {
+class BrowserTitlebar : public NotificationObserver,
+ public ActiveWindowWatcherX::Observer,
+ public menus::SimpleMenuModel::Delegate {
public:
BrowserTitlebar(BrowserWindowGtk* browser_window, GtkWindow* window);
virtual ~BrowserTitlebar();
@@ -76,6 +78,11 @@ class BrowserTitlebar : public MenuGtk::Delegate,
int current_waiting_frame_;
};
+ class ContextMenuModel : public menus::SimpleMenuModel {
+ public:
+ explicit ContextMenuModel(menus::SimpleMenuModel::Delegate* delegate);
+ };
+
// Build the titlebar, the space above the tab
// strip, and (maybe) the min, max, close buttons. |container| is the gtk
// continer that we put the widget into.
@@ -120,10 +127,12 @@ class BrowserTitlebar : public MenuGtk::Delegate,
// -- Context Menu -----------------------------------------------------------
- // MenuGtk::Delegate implementation:
- virtual bool IsCommandEnabled(int command_id) const;
- virtual bool IsItemChecked(int command_id) const;
- virtual void ExecuteCommandById(int command_id);
+ // SimpleMenuModel::Delegate implementation:
+ virtual bool IsCommandIdEnabled(int command_id) const;
+ virtual bool IsCommandIdChecked(int command_id) const;
+ virtual void ExecuteCommand(int command_id);
+ virtual bool GetAcceleratorForCommandId(int command_id,
+ menus::Accelerator* accelerator);
// Overridden from NotificationObserver:
virtual void Observe(NotificationType type,
@@ -173,11 +182,13 @@ class BrowserTitlebar : public MenuGtk::Delegate,
scoped_ptr<CustomDrawButton> restore_button_;
scoped_ptr<CustomDrawButton> close_button_;
- // The context menu.
+ // The context menu view and model.
scoped_ptr<MenuGtk> context_menu_;
+ scoped_ptr<ContextMenuModel> context_menu_model_;
- // The favicon menu.
+ // The favicon menu view and model.
scoped_ptr<MenuGtk> favicon_menu_;
+ scoped_ptr<PopupPageMenuModel> favicon_menu_model_;
// The throbber used when the window is in app mode or popup window mode.
Throbber throbber_;