diff options
author | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-13 02:13:46 +0000 |
---|---|---|
committer | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-13 02:13:46 +0000 |
commit | e7dadfcbac3fb76aa14119a54cd3ff34c8917ca2 (patch) | |
tree | 346f514b9809180910e558bbfed851871bef383b | |
parent | 4e1c76f34b910c6e9a832cbac2e2bcce8acc9f52 (diff) | |
download | chromium_src-e7dadfcbac3fb76aa14119a54cd3ff34c8917ca2.zip chromium_src-e7dadfcbac3fb76aa14119a54cd3ff34c8917ca2.tar.gz chromium_src-e7dadfcbac3fb76aa14119a54cd3ff34c8917ca2.tar.bz2 |
Revert 31869 - Ignore keyboard messages from enter key in renderer if they were not initiated there.
BUG=26755
TEST=Enter messages initiated in omnibox should not propagate to renderer
Review URL: http://codereview.chromium.org/384101
TBR=georgey@chromium.org
Review URL: http://codereview.chromium.org/384109
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31877 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/renderer_host/render_widget_host_view_win.cc | 28 | ||||
-rw-r--r-- | chrome/browser/renderer_host/render_widget_host_view_win.h | 3 |
2 files changed, 1 insertions, 30 deletions
diff --git a/chrome/browser/renderer_host/render_widget_host_view_win.cc b/chrome/browser/renderer_host/render_widget_host_view_win.cc index 76ff9f5..837cdf9 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_win.cc +++ b/chrome/browser/renderer_host/render_widget_host_view_win.cc @@ -216,7 +216,6 @@ RenderWidgetHostViewWin::RenderWidgetHostViewWin(RenderWidgetHost* widget) : render_widget_host_(widget), track_mouse_leave_(false), ime_notification_(false), - capture_enter_key_(false), is_hidden_(false), about_to_validate_and_paint_(false), close_on_deactivate_(false), @@ -1188,32 +1187,7 @@ LRESULT RenderWidgetHostViewWin::OnKeyEvent(UINT message, WPARAM wparam, } } - // Special processing for enter key: When user hits enter in omnibox - // we change focus to render host after the navigation, so repeat WM_KEYDOWNs - // and WM_KEYUP are going to render host, despite being initiated in other - // window. This code filters out these messages. - bool ignore_keyboard_event = false; - if (wparam == VK_RETURN) { - if (message == WM_KEYDOWN) { - if (KF_REPEAT & HIWORD(lparam)) { - // this is a repeated key - if (!capture_enter_key_) - ignore_keyboard_event = true; - } else { - capture_enter_key_ = true; - } - } else if (message == WM_KEYUP) { - if (!capture_enter_key_) - ignore_keyboard_event = true; - capture_enter_key_ = false; - } else { - // Ignore all other keyboard events for the enter key if not captured. - if (!capture_enter_key_) - ignore_keyboard_event = true; - } - } - - if (render_widget_host_ && !ignore_keyboard_event) { + if (render_widget_host_) { render_widget_host_->ForwardKeyboardEvent( NativeWebKeyboardEvent(m_hWnd, message, wparam, lparam)); } diff --git a/chrome/browser/renderer_host/render_widget_host_view_win.h b/chrome/browser/renderer_host/render_widget_host_view_win.h index 2fc3d80..4601ec2 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_win.h +++ b/chrome/browser/renderer_host/render_widget_host_view_win.h @@ -241,9 +241,6 @@ class RenderWidgetHostViewWin : // messages about the focused edit control from a renderer process. bool ime_notification_; - // true if Enter was hit when render widget host was in focus. - bool capture_enter_key_; - // true if the View is not visible. bool is_hidden_; |