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

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

Issue 1915243004: Merge https://codereview.chromium.org/1920033003. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
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..8aab8bed6f3ad5dc59c6b3f6e158e222820802e1 100644
--- a/remoting/client/plugin/pepper_input_handler.cc
+++ b/remoting/client/plugin/pepper_input_handler.cc
@@ -87,6 +87,17 @@ 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 new names and convert them to the old ones (because
+ // this code is compiled against the old table in the M51 branch).
+ if (dom_code == "MetaLeft") {
+ dom_code = "OSLeft";
+ } else if (dom_code == "MetaRight") {
+ dom_code = "OSRight";
+ }
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