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

Unified Diff: remoting/client/normalizing_input_filter_mac.cc

Issue 1403583003: Use standard DOM code definitions instead of custom. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Windows compile. 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/client/normalizing_input_filter_mac.cc
diff --git a/remoting/client/normalizing_input_filter_mac.cc b/remoting/client/normalizing_input_filter_mac.cc
index a3d366137326c5fd6e5bc9bf61287d79dcae1262..5d081fa6d06d9005c580c96da9424f68097512d4 100644
--- a/remoting/client/normalizing_input_filter_mac.cc
+++ b/remoting/client/normalizing_input_filter_mac.cc
@@ -9,7 +9,7 @@
#include "base/logging.h"
#include "remoting/proto/event.pb.h"
-#include "remoting/protocol/usb_key_codes.h"
+#include "ui/events/keycodes/dom/dom_code.h"
namespace remoting {
@@ -24,18 +24,22 @@ void NormalizingInputFilterMac::InjectKeyEvent(const protocol::KeyEvent& event)
{
DCHECK(event.has_usb_keycode());
- bool is_special_key = event.usb_keycode() == kUsbLeftControl ||
- event.usb_keycode() == kUsbLeftShift ||
- event.usb_keycode() == kUsbLeftAlt ||
- event.usb_keycode() == kUsbRightControl ||
- event.usb_keycode() == kUsbRightShift ||
- event.usb_keycode() == kUsbRightAlt ||
- event.usb_keycode() == kUsbTab;
+ ui::DomCode dom_code = static_cast<ui::DomCode>(event.usb_keycode());
- bool is_cmd_key = event.usb_keycode() == kUsbLeftOs ||
- event.usb_keycode() == kUsbRightOs;
+ bool is_special_key =
+ dom_code == ui::DomCode::CONTROL_LEFT ||
+ dom_code == ui::DomCode::SHIFT_LEFT ||
+ dom_code == ui::DomCode::ALT_LEFT ||
+ dom_code == ui::DomCode::CONTROL_RIGHT ||
+ dom_code == ui::DomCode::SHIFT_RIGHT ||
+ dom_code == ui::DomCode::ALT_RIGHT ||
+ dom_code == ui::DomCode::TAB;
- if (event.usb_keycode() == kUsbCapsLock) {
+ bool is_cmd_key =
+ dom_code == ui::DomCode::OS_LEFT ||
+ dom_code == ui::DomCode::OS_RIGHT;
+
+ if (dom_code == ui::DomCode::CAPS_LOCK) {
// Mac OS X generates keydown/keyup on lock-state transitions, rather than
// when the key is pressed & released, so fake keydown/keyup on each event.
protocol::KeyEvent newEvent(event);

Powered by Google App Engine
This is Rietveld 408576698