diff options
author | paulg@google.com <paulg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-05 02:34:30 +0000 |
---|---|---|
committer | paulg@google.com <paulg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-05 02:34:30 +0000 |
commit | d906d762e4d790ee208806549187998cc845d02f (patch) | |
tree | a14f3e9a7f03c5dcf8dcbfff7afd66139a3f5cab /webkit/tools | |
parent | 8f6dc080951e52485b034d2d607e366d3745fcf5 (diff) | |
download | chromium_src-d906d762e4d790ee208806549187998cc845d02f.zip chromium_src-d906d762e4d790ee208806549187998cc845d02f.tar.gz chromium_src-d906d762e4d790ee208806549187998cc845d02f.tar.bz2 |
Allow HTML select elements to work in the Windows test_shell.
Setting the focus after the WebWidget handles the input event
instantly closes the popup menu created by the select control.
This change allows the popup menus to appear after one click
(as expected) and does not trigger the issue where the main
page never regains keyboard focus.
Review URL: http://codereview.chromium.org/40147
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10964 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools')
-rw-r--r-- | webkit/tools/test_shell/webwidget_host_win.cc | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/webkit/tools/test_shell/webwidget_host_win.cc b/webkit/tools/test_shell/webwidget_host_win.cc index a81ed21..b8430af 100644 --- a/webkit/tools/test_shell/webwidget_host_win.cc +++ b/webkit/tools/test_shell/webwidget_host_win.cc @@ -283,6 +283,11 @@ void WebWidgetHost::MouseEvent(UINT message, WPARAM wparam, LPARAM lparam) { break; case WebInputEvent::MOUSE_DOWN: SetCapture(view_); + // This mimics a temporary workaround in RenderWidgetHostViewWin + // for bug 765011 to get focus when the mouse is clicked. This + // happens after the mouse down event is sent to the renderer + // because normally Windows does a WM_SETFOCUS after WM_LBUTTONDOWN. + ::SetFocus(view_); break; case WebInputEvent::MOUSE_UP: if (GetCapture() == view_) @@ -290,14 +295,6 @@ void WebWidgetHost::MouseEvent(UINT message, WPARAM wparam, LPARAM lparam) { break; } webwidget_->HandleInputEvent(&event); - - if (event.type == WebInputEvent::MOUSE_DOWN) { - // This mimics a temporary workaround in RenderWidgetHostViewWin - // for bug 765011 to get focus when the mouse is clicked. This - // happens after the mouse down event is sent to the renderer - // because normally Windows does a WM_SETFOCUS after WM_LBUTTONDOWN. - ::SetFocus(view_); - } } void WebWidgetHost::WheelEvent(WPARAM wparam, LPARAM lparam) { |