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

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

Issue 872883003: [PATCH 2/11] ozone: evdev: Move KeyboardEvdev usage during dispatch to EventFactoryEvdev (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updates for events_unittests Created 5 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 c569bb9a8a3de3629cc61bc1d7af37e6923e454d..5ba1ed91bc996ef7e520cf7b22e62148d969e12d 100644
--- a/ui/events/ozone/evdev/keyboard_evdev.cc
+++ b/ui/events/ozone/evdev/keyboard_evdev.cc
@@ -8,6 +8,7 @@
#include "ui/events/event_constants.h"
#include "ui/events/keycodes/dom4/keycode_converter.h"
#include "ui/events/ozone/evdev/event_modifiers_evdev.h"
+#include "ui/events/ozone/evdev/keyboard_util_evdev.h"
#include "ui/events/ozone/layout/keyboard_layout_engine.h"
#include "ui/events/ozone/layout/keyboard_layout_engine_manager.h"
#include "ui/events/ozone/layout/layout_util.h"
@@ -16,8 +17,6 @@ namespace ui {
namespace {
-const int kXkbKeycodeOffset = 8;
-
const int kRepeatDelayMs = 500;
const int kRepeatIntervalMs = 50;
@@ -181,19 +180,4 @@ void KeyboardEvdev::DispatchKey(unsigned int key, bool down, bool repeat) {
callback_.Run(make_scoped_ptr(event));
}
-// static
-int KeyboardEvdev::NativeCodeToEvdevCode(int native_code) {
- if (native_code == KeycodeConverter::InvalidNativeKeycode()) {
- return KEY_RESERVED;
- }
- return native_code - kXkbKeycodeOffset;
-}
-
-// static
-int KeyboardEvdev::EvdevCodeToNativeCode(int evdev_code) {
- if (evdev_code == KEY_RESERVED)
- return KeycodeConverter::InvalidNativeKeycode();
- return evdev_code + kXkbKeycodeOffset;
-}
-
} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698