diff options
author | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-03 16:02:04 +0000 |
---|---|---|
committer | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-03 16:02:04 +0000 |
commit | 5a7f0b9b48976c5e043eabf4d6e54f0cf19f01c9 (patch) | |
tree | ff82b5f19bb106cbd67984c44604b414289ba12b /chrome | |
parent | 5982f1f39f5cab5a9e6d61ac2386d0f09c7cf0c7 (diff) | |
download | chromium_src-5a7f0b9b48976c5e043eabf4d6e54f0cf19f01c9.zip chromium_src-5a7f0b9b48976c5e043eabf4d6e54f0cf19f01c9.tar.gz chromium_src-5a7f0b9b48976c5e043eabf4d6e54f0cf19f01c9.tar.bz2 |
Fixing WebKeyboardEvent. Third time's the charm.
Review URL: http://codereview.chromium.org/27332
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10794 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
6 files changed, 10 insertions, 13 deletions
diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc index f4349a1..9f174fa 100644 --- a/chrome/browser/renderer_host/render_view_host.cc +++ b/chrome/browser/renderer_host/render_view_host.cc @@ -1211,7 +1211,8 @@ void RenderViewHost::UnhandledKeyboardEvent(const WebKeyboardEvent& event) { // TODO(brettw) why do we have to filter these types of events here. Can't // the renderer just send us the ones we care abount, or maybe the view // should be able to decide which ones it wants or not? - if ((event.type == WebInputEvent::KEY_DOWN) || + if ((event.type == WebInputEvent::RAW_KEY_DOWN) || + (event.type == WebInputEvent::KEY_DOWN) || (event.type == WebInputEvent::CHAR)) { view->HandleKeyboardEvent(event); } diff --git a/chrome/browser/renderer_host/render_widget_host.cc b/chrome/browser/renderer_host/render_widget_host.cc index 1050ec7..6951e3d 100644 --- a/chrome/browser/renderer_host/render_widget_host.cc +++ b/chrome/browser/renderer_host/render_widget_host.cc @@ -293,8 +293,8 @@ void RenderWidgetHost::ForwardWheelEvent( void RenderWidgetHost::ForwardKeyboardEvent(const WebKeyboardEvent& key_event) { if (key_event.type == WebKeyboardEvent::CHAR && - (key_event.key_code == base::VKEY_RETURN || - key_event.key_code == base::VKEY_SPACE)) { + (key_event.windows_key_code == base::VKEY_RETURN || + key_event.windows_key_code == base::VKEY_SPACE)) { OnEnterOrSpace(); } diff --git a/chrome/browser/renderer_host/render_widget_host_unittest.cc b/chrome/browser/renderer_host/render_widget_host_unittest.cc index 7a720c3..4e42e45 100644 --- a/chrome/browser/renderer_host/render_widget_host_unittest.cc +++ b/chrome/browser/renderer_host/render_widget_host_unittest.cc @@ -334,7 +334,7 @@ TEST_F(RenderWidgetHostTest, HandleKeyEventsWeSent) { WebKeyboardEvent key_event; key_event.type = WebInputEvent::KEY_DOWN; key_event.modifiers = WebInputEvent::CTRL_KEY; - key_event.key_code = base::VKEY_L; // non-null made up value. + key_event.windows_key_code = base::VKEY_L; // non-null made up value. host_->ForwardKeyboardEvent(key_event); diff --git a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc index 750cb48f..13c1eb2 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc +++ b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc @@ -77,13 +77,6 @@ class RenderWidgetHostViewGtkWidget { RenderWidgetHostViewGtk* host_view) { WebKeyboardEvent wke(event); host_view->GetRenderWidgetHost()->ForwardKeyboardEvent(wke); - - // See note in webwidget_host_gtk.cc::HandleKeyPress(). - if (event->type == GDK_KEY_PRESS) { - wke.type = WebKeyboardEvent::CHAR; - host_view->GetRenderWidgetHost()->ForwardKeyboardEvent(wke); - } - return FALSE; } diff --git a/chrome/browser/tab_contents/web_contents_view_win.cc b/chrome/browser/tab_contents/web_contents_view_win.cc index bdbf89c..f4bd418 100644 --- a/chrome/browser/tab_contents/web_contents_view_win.cc +++ b/chrome/browser/tab_contents/web_contents_view_win.cc @@ -259,13 +259,13 @@ void WebContentsViewWin::HandleKeyboardEvent(const WebKeyboardEvent& event) { // The renderer returned a keyboard event it did not process. This may be // a keyboard shortcut that we have to process. - if (event.type == WebInputEvent::KEY_DOWN) { + if (event.type == WebInputEvent::RAW_KEY_DOWN) { views::FocusManager* focus_manager = views::FocusManager::GetFocusManager(GetHWND()); // We may not have a focus_manager at this point (if the tab has been // switched by the time this message returned). if (focus_manager) { - views::Accelerator accelerator(event.key_code, + views::Accelerator accelerator(event.windows_key_code, (event.modifiers & WebInputEvent::SHIFT_KEY) == WebInputEvent::SHIFT_KEY, (event.modifiers & WebInputEvent::CTRL_KEY) == diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h index e91bdf0..582bf3a 100755 --- a/chrome/common/render_messages.h +++ b/chrome/common/render_messages.h @@ -495,6 +495,9 @@ struct ParamTraits<WebInputEvent::Type> { case WebInputEvent::MOUSE_WHEEL: type = L"MOUSE_WHEEL"; break; + case WebInputEvent::RAW_KEY_DOWN: + type = L"RAW_KEY_DOWN"; + break; case WebInputEvent::KEY_DOWN: type = L"KEY_DOWN"; break; |