Index: content/browser/renderer_host/input/web_input_event_builders_android.cc |
diff --git a/content/browser/renderer_host/input/web_input_event_builders_android.cc b/content/browser/renderer_host/input/web_input_event_builders_android.cc |
index 37dd16af7280d7c349738c9640ae8c52404f078d..e35327088103665e891a35c269785c70cf53fac0 100644 |
--- a/content/browser/renderer_host/input/web_input_event_builders_android.cc |
+++ b/content/browser/renderer_host/input/web_input_event_builders_android.cc |
@@ -8,6 +8,8 @@ |
#include "content/browser/renderer_host/input/motion_event_android.h" |
#include "content/browser/renderer_host/input/web_input_event_util.h" |
#include "content/browser/renderer_host/input/web_input_event_util_posix.h" |
+#include "ui/events/keycodes/dom/dom_code.h" |
+#include "ui/events/keycodes/dom/keycode_converter.h" |
#include "ui/events/keycodes/keyboard_code_conversion_android.h" |
#include "ui/events/keycodes/keyboard_codes_posix.h" |
@@ -25,11 +27,17 @@ WebKeyboardEvent WebKeyboardEventBuilder::Build(WebInputEvent::Type type, |
int modifiers, |
double time_sec, |
int keycode, |
+ int scancode, |
int unicode_character, |
bool is_system_key) { |
DCHECK(WebInputEvent::isKeyboardEventType(type)); |
WebKeyboardEvent result; |
+ ui::DomCode dom_code = ui::DomCode::NONE; |
+ if (scancode != 0) |
+ dom_code = ui::KeycodeConverter::NativeKeycodeToDomCode(scancode); |
+ if (dom_code == ui::DomCode::NONE) |
+ dom_code = ui::DomCodeFromAndroidKeyCode(keycode); |
Sergey Ulanov
2015/09/09 19:55:44
I don't think this is the right approach. DomCodeF
dtapuska
2015/09/09 20:00:13
So what is your preferred fallback? Not to set the
Sergey Ulanov
2015/09/09 20:20:30
I'm not sure, but I think not setting it at all wo
|
result.type = type; |
result.modifiers = modifiers; |
result.timeStampSeconds = time_sec; |
@@ -38,6 +46,7 @@ WebKeyboardEvent WebKeyboardEventBuilder::Build(WebInputEvent::Type type, |
UpdateWindowsKeyCodeAndKeyIdentifier(&result, windows_key_code); |
result.modifiers |= GetLocationModifiersFromWindowsKeyCode(windows_key_code); |
result.nativeKeyCode = keycode; |
+ result.domCode = static_cast<int>(dom_code); |
result.unmodifiedText[0] = unicode_character; |
if (result.windowsKeyCode == ui::VKEY_RETURN) { |
// This is the same behavior as GTK: |