summaryrefslogtreecommitdiffstats
path: root/chrome/browser/page_menu_model.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/page_menu_model.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/page_menu_model.h')
-rw-r--r--chrome/browser/page_menu_model.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/chrome/browser/page_menu_model.h b/chrome/browser/page_menu_model.h
index 59994a9..a143adc 100644
--- a/chrome/browser/page_menu_model.h
+++ b/chrome/browser/page_menu_model.h
@@ -78,4 +78,25 @@ class PageMenuModel : public menus::SimpleMenuModel {
DISALLOW_COPY_AND_ASSIGN(PageMenuModel);
};
+// A menu model that builds the contents of the menu shown for popups (when the
+// user clicks on the favicon) and all of its submenus.
+class PopupPageMenuModel : public menus::SimpleMenuModel {
+ public:
+ explicit PopupPageMenuModel(menus::SimpleMenuModel::Delegate* delegate,
+ Browser* browser);
+ virtual ~PopupPageMenuModel() { }
+
+ private:
+ void Build();
+
+ // Models for submenus referenced by this model. SimpleMenuModel only uses
+ // weak references so these must be kept for the lifetime of the top-level
+ // model.
+ scoped_ptr<ZoomMenuModel> zoom_menu_model_;
+ scoped_ptr<EncodingMenuModel> encoding_menu_model_;
+ Browser* browser_; // weak
+
+ DISALLOW_COPY_AND_ASSIGN(PopupPageMenuModel);
+};
+
#endif // CHROME_BROWSER_PAGE_MENU_MODEL_H_