summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-04 21:04:04 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-04 21:04:04 +0000
commit3ebf9af0cd55de5d312f0df5254580ab60ac0c64 (patch)
tree9d332e0833925545f0cdce851e349a9b109626b6 /chrome/browser
parent076bf0b69eafa42accb20e5ccfe23805ed91655d (diff)
downloadchromium_src-3ebf9af0cd55de5d312f0df5254580ab60ac0c64.zip
chromium_src-3ebf9af0cd55de5d312f0df5254580ab60ac0c64.tar.gz
chromium_src-3ebf9af0cd55de5d312f0df5254580ab60ac0c64.tar.bz2
Fixing WebKeyboardEvent.
Review URL: http://codereview.chromium.org/39075 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10918 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/renderer_host/render_view_host.cc3
-rw-r--r--chrome/browser/renderer_host/render_widget_host.cc4
-rw-r--r--chrome/browser/renderer_host/render_widget_host_unittest.cc2
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_gtk.cc7
-rw-r--r--chrome/browser/tab_contents/web_contents_view_win.cc6
5 files changed, 8 insertions, 14 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 ad677c1..da37f01 100644
--- a/chrome/browser/renderer_host/render_widget_host_unittest.cc
+++ b/chrome/browser/renderer_host/render_widget_host_unittest.cc
@@ -330,7 +330,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..c66d339 100644
--- a/chrome/browser/tab_contents/web_contents_view_win.cc
+++ b/chrome/browser/tab_contents/web_contents_view_win.cc
@@ -249,7 +249,7 @@ void WebContentsViewWin::TakeFocus(bool reverse) {
void WebContentsViewWin::HandleKeyboardEvent(const WebKeyboardEvent& event) {
// Previous calls to TranslateMessage can generate CHAR events as well as
- // KEY_DOWN events, even if the latter triggered an accelerator. In these
+ // RAW_KEY_DOWN events, even if the latter triggered an accelerator. In these
// cases, we discard the CHAR events.
if (event.type == WebInputEvent::CHAR && ignore_next_char_event_) {
ignore_next_char_event_ = false;
@@ -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) ==