summaryrefslogtreecommitdiffstats
path: root/chrome_frame/chrome_frame_plugin.h
diff options
context:
space:
mode:
authorrhashimoto@chromium.org <rhashimoto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-12 16:54:12 +0000
committerrhashimoto@chromium.org <rhashimoto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-12 16:54:12 +0000
commitb516e2d2ff5ad3d2a7c754b081566137fd7ed089 (patch)
tree75d5a32b65ce6b417eba6ff42fe0dbe3d1d8c5b1 /chrome_frame/chrome_frame_plugin.h
parent471072f9fd132a46b24ddd159922f6a4d099707d (diff)
downloadchromium_src-b516e2d2ff5ad3d2a7c754b081566137fd7ed089.zip
chromium_src-b516e2d2ff5ad3d2a7c754b081566137fd7ed089.tar.gz
chromium_src-b516e2d2ff5ad3d2a7c754b081566137fd7ed089.tar.bz2
Convert RenderViewContextMenu to MenuItemView.
This CL is part of general GTK removal for ChromiumOS. Menu2 uses GTK on linux so we are replacing it with MenuItemView. Chrome Frame currently passes the context menu between processes by using the HMENU. Because MenuItemView does not use HMENU, we need to use another mechanism. This CL creates a ContextMenuModel struct that is serialized into an automation message for Chrome Frame. ContextMenuModel contains the context menu definition in-band replacing the out-of-band HMENU. BUG=chromium-os:13887 TEST=none Review URL: http://codereview.chromium.org/7167002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92182 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/chrome_frame_plugin.h')
-rw-r--r--chrome_frame/chrome_frame_plugin.h17
1 files changed, 7 insertions, 10 deletions
diff --git a/chrome_frame/chrome_frame_plugin.h b/chrome_frame/chrome_frame_plugin.h
index af4242a..51106ab 100644
--- a/chrome_frame/chrome_frame_plugin.h
+++ b/chrome_frame/chrome_frame_plugin.h
@@ -120,23 +120,20 @@ END_MSG_MAP()
OnLoadFailed(error_code, gurl.spec());
}
- virtual void OnHandleContextMenu(HANDLE menu_handle,
+ virtual void OnHandleContextMenu(const ContextMenuModel& menu_model,
int align_flags,
const MiniContextMenuParams& params) {
- if (!menu_handle || !automation_client_.get()) {
+ if (!automation_client_.get()) {
NOTREACHED();
return;
}
- // TrackPopupMenuEx call will fail on IE on Vista running
- // in low integrity mode. We DO seem to be able to enumerate the menu
- // though, so just clone it and show the copy:
- HMENU copy = UtilCloneContextMenu(static_cast<HMENU>(menu_handle));
- if (!copy)
+ HMENU menu = BuildContextMenu(menu_model);
+ if (!menu)
return;
T* self = static_cast<T*>(this);
- if (self->PreProcessContextMenu(copy)) {
+ if (self->PreProcessContextMenu(menu)) {
// In order for the context menu to handle keyboard input, give the
// ActiveX window focus.
ignore_setfocus_ = true;
@@ -145,7 +142,7 @@ END_MSG_MAP()
UINT flags = align_flags | TPM_LEFTBUTTON | TPM_RETURNCMD | TPM_RECURSE;
int x, y;
ChromeFramePluginGetParamsCoordinates(params, &x, &y);
- UINT selected = TrackPopupMenuEx(copy, flags, x, y, GetWindow(), NULL);
+ UINT selected = TrackPopupMenuEx(menu, flags, x, y, GetWindow(), NULL);
// Menu is over now give focus back to chrome
GiveFocusToChrome(false);
if (IsValid() && selected != 0 &&
@@ -154,7 +151,7 @@ END_MSG_MAP()
}
}
- DestroyMenu(copy);
+ DestroyMenu(menu);
}
LRESULT OnSetFocus(UINT message, WPARAM wparam, LPARAM lparam,