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

Unified Diff: remoting/client/plugin/pepper_input_handler.cc

Issue 1920033003: Work around key lookup table version mismatch. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/plugin/pepper_input_handler.cc
diff --git a/remoting/client/plugin/pepper_input_handler.cc b/remoting/client/plugin/pepper_input_handler.cc
index 4b65264966e4d452729ba5b325ca9bdec4b21abb..2f9c931516ce8b5b5fd30d9790184fcfd636db4d 100644
--- a/remoting/client/plugin/pepper_input_handler.cc
+++ b/remoting/client/plugin/pepper_input_handler.cc
@@ -87,6 +87,16 @@ uint32_t MakeLockStates(const pp::InputEvent& event) {
protocol::KeyEvent MakeKeyEvent(const pp::KeyboardInputEvent& pp_key_event) {
protocol::KeyEvent key_event;
std::string dom_code = pp_key_event.GetCode().AsString();
+ // Chrome M52 changed the string representation of the left and right OS
+ // keys, which means that if the client plugin is compiled against a
+ // different version of the mapping table, the lookup will fail. The long-
+ // term solution is to use JavaScript input events, but for now just check
+ // explicitly for the old names and convert them to the new ones.
+ if (dom_code == "OSLeft") {
+ dom_code = "MetaLeft";
+ } else if (dom_code == "OSRight") {
+ dom_code = "MetaRight";
+ }
key_event.set_usb_keycode(ui::KeycodeConverter::CodeToUsbKeycode(dom_code));
key_event.set_pressed(pp_key_event.GetType() == PP_INPUTEVENT_TYPE_KEYDOWN);
key_event.set_lock_states(MakeLockStates(pp_key_event));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698