summaryrefslogtreecommitdiffstats
path: root/chrome_frame/chrome_frame_plugin.h
diff options
context:
space:
mode:
authoramit@chromium.org <amit@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-12 18:19:07 +0000
committeramit@chromium.org <amit@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-12 18:19:07 +0000
commit4e676aa41d39aada2731e64f2807611cfad2c785 (patch)
tree409c055c2d5c1849e707e93b97f55e5afcdaf6b1 /chrome_frame/chrome_frame_plugin.h
parentaedd87e5b5e0ee568309eba54b31cb8aa12cd6e6 (diff)
downloadchromium_src-4e676aa41d39aada2731e64f2807611cfad2c785.zip
chromium_src-4e676aa41d39aada2731e64f2807611cfad2c785.tar.gz
chromium_src-4e676aa41d39aada2731e64f2807611cfad2c785.tar.bz2
First batch of context menu tests
Refactored various methods to send keyboard and mouse input. Fixed the context menu focus issue on IE7. Improved existing tests to make them less flaky and added 3 new tests for context menu items. BUG=34673 TEST=new tests added Review URL: http://codereview.chromium.org/604014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38905 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/chrome_frame_plugin.h')
-rw-r--r--chrome_frame/chrome_frame_plugin.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/chrome_frame/chrome_frame_plugin.h b/chrome_frame/chrome_frame_plugin.h
index 0e16001..293cb99 100644
--- a/chrome_frame/chrome_frame_plugin.h
+++ b/chrome_frame/chrome_frame_plugin.h
@@ -107,12 +107,19 @@ END_MSG_MAP()
if (!copy)
return;
- T* pThis = static_cast<T*>(this);
- if (pThis->PreProcessContextMenu(copy)) {
+ T* self = static_cast<T*>(this);
+ if (self->PreProcessContextMenu(copy)) {
+ // In order for the context menu to handle keyboard input, give the
+ // ActiveX window focus.
+ ignore_setfocus_ = true;
+ SetFocus(GetWindow());
+ ignore_setfocus_ = false;
UINT flags = align_flags | TPM_LEFTBUTTON | TPM_RETURNCMD | TPM_RECURSE;
UINT selected = TrackPopupMenuEx(copy, flags, params.screen_x,
params.screen_y, GetWindow(), NULL);
- if (selected != 0 && !pThis->HandleContextMenuCommand(selected, params)) {
+ // Menu is over now give focus back to chrome
+ GiveFocusToChrome();
+ if (selected != 0 && !self->HandleContextMenuCommand(selected, params)) {
automation_client_->SendContextMenuCommandToChromeFrame(selected);
}
}