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

Unified Diff: remoting/host/input_injector_x11.cc

Issue 1403583003: Use standard DOM code definitions instead of custom. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reviewer feedback. Created 5 years, 2 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
Index: remoting/host/input_injector_x11.cc
diff --git a/remoting/host/input_injector_x11.cc b/remoting/host/input_injector_x11.cc
index 62e13a17ecbfc42da6c674cc4904e6458494cbce..fc0c712d3f9891b5e3e93aefe56ba59c5670e3d7 100644
--- a/remoting/host/input_injector_x11.cc
+++ b/remoting/host/input_injector_x11.cc
@@ -25,8 +25,8 @@
#include "remoting/host/clipboard.h"
#include "remoting/host/linux/unicode_to_keysym.h"
#include "remoting/proto/internal.pb.h"
-#include "remoting/protocol/usb_key_codes.h"
#include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h"
+#include "ui/events/keycodes/dom/dom_code.h"
#include "ui/events/keycodes/dom/keycode_converter.h"
namespace remoting {
@@ -89,15 +89,15 @@ bool FindKeycodeForUnicode(Display* display,
return false;
}
-bool IsModifierKey(int usb_keycode) {
- return usb_keycode == kUsbLeftControl ||
- usb_keycode == kUsbLeftShift ||
- usb_keycode == kUsbLeftAlt ||
- usb_keycode == kUsbLeftOs ||
- usb_keycode == kUsbRightControl ||
- usb_keycode == kUsbRightShift ||
- usb_keycode == kUsbRightAlt ||
- usb_keycode == kUsbRightOs;
+bool IsModifierKey(ui::DomCode dom_code) {
+ return dom_code == ui::DomCode::CONTROL_LEFT ||
+ dom_code == ui::DomCode::SHIFT_LEFT ||
+ dom_code == ui::DomCode::ALT_LEFT ||
+ dom_code == ui::DomCode::OS_LEFT ||
+ dom_code == ui::DomCode::CONTROL_RIGHT ||
+ dom_code == ui::DomCode::SHIFT_RIGHT ||
+ dom_code == ui::DomCode::ALT_RIGHT ||
+ dom_code == ui::DomCode::OS_RIGHT;
}
// Pixel-to-wheel-ticks conversion ratio used by GTK.
@@ -314,7 +314,7 @@ void InputInjectorX11::Core::InjectKeyEvent(const KeyEvent& event) {
if (event.pressed()) {
if (pressed_keys_.find(keycode) != pressed_keys_.end()) {
// Ignore repeats for modifier keys.
- if (IsModifierKey(event.usb_keycode()))
+ if (IsModifierKey(static_cast<ui::DomCode>(event.usb_keycode())))
return;
// Key is already held down, so lift the key up to ensure this repeated
// press takes effect.
« no previous file with comments | « remoting/client/normalizing_input_filter_mac_unittest.cc ('k') | remoting/host/win/session_input_injector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698