summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-12 03:50:39 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-12 03:50:39 +0000
commite943d666020b7275d7fb70db625b47f69712d3b3 (patch)
treed56f0d56bb766103e8c51566f46197966a689cb1 /views
parentd66688b2a167882dad56fcb6d963d918ed413052 (diff)
downloadchromium_src-e943d666020b7275d7fb70db625b47f69712d3b3.zip
chromium_src-e943d666020b7275d7fb70db625b47f69712d3b3.tar.gz
chromium_src-e943d666020b7275d7fb70db625b47f69712d3b3.tar.bz2
Allow external hosts to handle the context menu and thus be able to customize it.
Changes include 1. A HandleContextMenu function which can be implemented by a TabContentsDelegate. Currently only ExternalTabContainer implements this. 2. Removed InitMenu calls from the RenderViewContextMenu subclass constructors, We need the subclasses to be able to override individual AddMenuItem calls. The newly added RenderViewContextMenuExternalWin class derives from RenderViewContextMenuWin whose constructor calls InitMenu. This happens at a time when the vtable is not yet setup. To fix this we added an Init function to the RenderViewContextMenu base class which then calls a virtual function DoInit, which derived classes can override to perform specific initializations. 3. Added automation messages to send over context menu events to external hosts and back amit, please review everything. estade please review changes to tab_contents_view_gtk.cc and render_view_context_menu_gtk.cc. pinkerton please review changes to tab_contents_view_mac.mm and render_view_context_menu_mac.mm Review URL: http://codereview.chromium.org/119429 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18250 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/controls/menu/menu.h5
-rw-r--r--views/controls/menu/menu_win.h10
2 files changed, 12 insertions, 3 deletions
diff --git a/views/controls/menu/menu.h b/views/controls/menu/menu.h
index faf4a7b..b93ef98 100644
--- a/views/controls/menu/menu.h
+++ b/views/controls/menu/menu.h
@@ -271,6 +271,11 @@ class Menu {
// Returns the number of menu items.
virtual int ItemCount() = 0;
+#if defined(OS_WIN)
+ // Returns the underlying menu handle
+ virtual HMENU GetMenuHandle() const = 0;
+#endif // defined(OS_WIN)
+
protected:
explicit Menu(Menu* parent);
diff --git a/views/controls/menu/menu_win.h b/views/controls/menu/menu_win.h
index 5022db7..0469c12 100644
--- a/views/controls/menu/menu_win.h
+++ b/views/controls/menu/menu_win.h
@@ -63,6 +63,13 @@ class MenuWin : public Menu {
virtual void Cancel();
virtual int ItemCount();
+ virtual HMENU GetMenuHandle() const {
+ return menu_;
+ }
+
+ // Gets the Win32 TPM alignment flags for the specified AnchorPoint.
+ DWORD GetTPMAlignFlags() const;
+
protected:
virtual void AddMenuItemInternal(int index,
int item_id,
@@ -91,9 +98,6 @@ class MenuWin : public Menu {
// the state of the item in preference to |controller_|.
UINT GetStateFlagsForItemID(int item_id) const;
- // Gets the Win32 TPM alignment flags for the specified AnchorPoint.
- DWORD GetTPMAlignFlags() const;
-
// The Win32 Menu Handle we wrap
HMENU menu_;