Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(321)

Unified Diff: content/browser/devtools/protocol/input_handler.cc

Issue 1143073007: [KeyboardEvent] DOM |Key| support in dispatchKeyEvent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Instead of copying it reuses other function Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/devtools/protocol/input_handler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/devtools/protocol/input_handler.cc
diff --git a/content/browser/devtools/protocol/input_handler.cc b/content/browser/devtools/protocol/input_handler.cc
index 610b71cd3390c4d0cf403ba2afe5e3f1ae713c3b..33fd42b7b48ac6e78c490998e42767fb7981fc9f 100644
--- a/content/browser/devtools/protocol/input_handler.cc
+++ b/content/browser/devtools/protocol/input_handler.cc
@@ -150,6 +150,7 @@ Response InputHandler::DispatchKeyEvent(
const std::string* unmodified_text,
const std::string* key_identifier,
const std::string* code,
+ const std::string* key,
const int* windows_virtual_key_code,
const int* native_virtual_key_code,
const bool* auto_repeat,
@@ -204,6 +205,11 @@ Response InputHandler::DispatchKeyEvent(
ui::KeycodeConverter::CodeStringToDomCode(code->c_str()));
}
+ if (key) {
+ event.domKey = static_cast<int>(
+ ui::KeycodeConverter::KeyStringToDomKey(key->c_str()));
+ }
+
if (!host_)
return Response::ServerError("Could not connect to view");
@@ -212,6 +218,26 @@ Response InputHandler::DispatchKeyEvent(
return Response::OK();
}
+Response InputHandler::DispatchKeyEvent(
+ const std::string& type,
+ const int* modifiers,
+ const double* timestamp,
+ const std::string* text,
+ const std::string* unmodified_text,
+ const std::string* key_identifier,
+ const std::string* code,
+ const int* windows_virtual_key_code,
+ const int* native_virtual_key_code,
+ const bool* auto_repeat,
+ const bool* is_keypad,
+ const bool* is_system_key) {
+ std::string dom_key;
+ return InputHandler::DispatchKeyEvent(type, modifiers, timestamp, text,
+ unmodified_text, key_identifier, code, &dom_key,
+ windows_virtual_key_code, native_virtual_key_code, auto_repeat,
+ is_keypad, is_system_key);
+}
+
Response InputHandler::DispatchMouseEvent(
const std::string& type,
int x,
« no previous file with comments | « content/browser/devtools/protocol/input_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698