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

Unified Diff: ui/events/ozone/evdev/keyboard_evdev.cc

Issue 1560293002: Rename KEY_ constants to avoid conflict with <linux/input.h> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments (Wez) Created 4 years, 11 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: ui/events/ozone/evdev/keyboard_evdev.cc
diff --git a/ui/events/ozone/evdev/keyboard_evdev.cc b/ui/events/ozone/evdev/keyboard_evdev.cc
index fbcc6c97858e0b3cdfbd30ec0bdc7745241b1f5f..b38d8cc3338801737f90cd67ddda40cd5b687224 100644
--- a/ui/events/ozone/evdev/keyboard_evdev.cc
+++ b/ui/events/ozone/evdev/keyboard_evdev.cc
@@ -9,6 +9,7 @@
#include "ui/events/event.h"
#include "ui/events/event_constants.h"
#include "ui/events/event_utils.h"
+#include "ui/events/keycodes/dom/dom_code.h"
#include "ui/events/keycodes/dom/keycode_converter.h"
#include "ui/events/ozone/evdev/event_modifiers_evdev.h"
#include "ui/events/ozone/evdev/keyboard_util_evdev.h"
@@ -18,15 +19,6 @@
namespace ui {
-// We can't include ui/events/keycodes/dom/dom_code.h here because of
-// conflicts with preprocessor macros in <linux/input.h>, so we use the
-// same underlying data with an additional prefix.
-#define USB_KEYMAP(usb, evdev, xkb, win, mac, code, id) DOM_CODE_ ## id = usb
-#define USB_KEYMAP_DECLARATION enum class DomCode
-#include "ui/events/keycodes/dom/keycode_converter_data.inc"
-#undef USB_KEYMAP
-#undef USB_KEYMAP_DECLARATION
-
namespace {
const int kRepeatDelayMs = 500;
@@ -161,7 +153,7 @@ void KeyboardEvdev::RefreshModifiers() {
continue;
DomCode dom_code =
KeycodeConverter::NativeKeycodeToDomCode(EvdevCodeToNativeCode(key));
- if (dom_code == DomCode::DOM_CODE_NONE)
+ if (dom_code == DomCode::NONE)
continue;
DomKey dom_key;
KeyboardCode keycode;
@@ -235,7 +227,7 @@ void KeyboardEvdev::DispatchKey(unsigned int key,
int device_id) {
DomCode dom_code =
KeycodeConverter::NativeKeycodeToDomCode(EvdevCodeToNativeCode(key));
- if (dom_code == DomCode::DOM_CODE_NONE)
+ if (dom_code == DomCode::NONE)
return;
int flags = modifiers_->GetModifierFlags();
DomKey dom_key;

Powered by Google App Engine
This is Rietveld 408576698