Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1394)

Unified Diff: chrome_frame/chrome_frame_plugin.h

Issue 604014: First batch of context menu tests... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome_frame/chrome_frame_plugin.h
===================================================================
--- chrome_frame/chrome_frame_plugin.h (revision 38776)
+++ chrome_frame/chrome_frame_plugin.h (working copy)
@@ -107,12 +107,19 @@
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);
}
}

Powered by Google App Engine
This is Rietveld 408576698