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

Side by Side Diff: remoting/client/plugin/pepper_input_handler.cc

Issue 2910873002: [System-Keyboard-Lock] Add KeycodeConverter::CodeStringToNativeKeycode() function (Closed)
Patch Set: Resolve review comments Created 3 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | ui/events/keycodes/dom/keycode_converter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "remoting/client/plugin/pepper_input_handler.h" 5 #include "remoting/client/plugin/pepper_input_handler.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "ppapi/cpp/image_data.h" 10 #include "ppapi/cpp/image_data.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 // Chrome M52 changed the string representation of the left and right OS 90 // Chrome M52 changed the string representation of the left and right OS
91 // keys, which means that if the client plugin is compiled against a 91 // keys, which means that if the client plugin is compiled against a
92 // different version of the mapping table, the lookup will fail. The long- 92 // different version of the mapping table, the lookup will fail. The long-
93 // term solution is to use JavaScript input events, but for now just check 93 // term solution is to use JavaScript input events, but for now just check
94 // explicitly for the old names and convert them to the new ones. 94 // explicitly for the old names and convert them to the new ones.
95 if (dom_code == "OSLeft") { 95 if (dom_code == "OSLeft") {
96 dom_code = "MetaLeft"; 96 dom_code = "MetaLeft";
97 } else if (dom_code == "OSRight") { 97 } else if (dom_code == "OSRight") {
98 dom_code = "MetaRight"; 98 dom_code = "MetaRight";
99 } 99 }
100 key_event.set_usb_keycode(ui::KeycodeConverter::CodeToUsbKeycode(dom_code)); 100 key_event.set_usb_keycode(
101 ui::KeycodeConverter::CodeStringToUsbKeycode(dom_code));
101 key_event.set_pressed(pp_key_event.GetType() == PP_INPUTEVENT_TYPE_KEYDOWN); 102 key_event.set_pressed(pp_key_event.GetType() == PP_INPUTEVENT_TYPE_KEYDOWN);
102 key_event.set_lock_states(MakeLockStates(pp_key_event)); 103 key_event.set_lock_states(MakeLockStates(pp_key_event));
103 return key_event; 104 return key_event;
104 } 105 }
105 106
106 // Builds a protocol::MouseEvent from the supplied PPAPI event. 107 // Builds a protocol::MouseEvent from the supplied PPAPI event.
107 protocol::MouseEvent MakeMouseEvent(const pp::MouseInputEvent& pp_mouse_event, 108 protocol::MouseEvent MakeMouseEvent(const pp::MouseInputEvent& pp_mouse_event,
108 bool set_deltas) { 109 bool set_deltas) {
109 protocol::MouseEvent mouse_event; 110 protocol::MouseEvent mouse_event;
110 mouse_event.set_x(pp_mouse_event.GetPosition().x()); 111 mouse_event.set_x(pp_mouse_event.GetPosition().x());
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 input_tracker_->ReleaseAllIfModifiersStuck( 287 input_tracker_->ReleaseAllIfModifiersStuck(
287 (modifiers & PP_INPUTEVENT_MODIFIER_ALTKEY) != 0, 288 (modifiers & PP_INPUTEVENT_MODIFIER_ALTKEY) != 0,
288 (modifiers & PP_INPUTEVENT_MODIFIER_CONTROLKEY) != 0, 289 (modifiers & PP_INPUTEVENT_MODIFIER_CONTROLKEY) != 0,
289 (modifiers & PP_INPUTEVENT_MODIFIER_METAKEY) != 0, 290 (modifiers & PP_INPUTEVENT_MODIFIER_METAKEY) != 0,
290 (modifiers & PP_INPUTEVENT_MODIFIER_SHIFTKEY) != 0); 291 (modifiers & PP_INPUTEVENT_MODIFIER_SHIFTKEY) != 0);
291 } 292 }
292 } 293 }
293 } 294 }
294 295
295 } // namespace remoting 296 } // namespace remoting
OLDNEW
« no previous file with comments | « no previous file | ui/events/keycodes/dom/keycode_converter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698