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

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

Issue 561243002: ozone: evdev: Move read polling into EventConverterEvdev (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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/key_event_converter_evdev.cc
diff --git a/ui/events/ozone/evdev/key_event_converter_evdev.cc b/ui/events/ozone/evdev/key_event_converter_evdev.cc
index caf3f199528bd7251d4c2dc38c7dd7e5c9f65893..3bcb5f2f251266727462cc4e056ad6db9107a61e 100644
--- a/ui/events/ozone/evdev/key_event_converter_evdev.cc
+++ b/ui/events/ozone/evdev/key_event_converter_evdev.cc
@@ -194,9 +194,8 @@ KeyEventConverterEvdev::KeyEventConverterEvdev(
base::FilePath path,
EventModifiersEvdev* modifiers,
const EventDispatchCallback& callback)
- : EventConverterEvdev(callback),
- fd_(fd),
- path_(path),
+ : EventConverterEvdev(fd, path),
+ callback_(callback),
modifiers_(modifiers) {
// TODO(spang): Initialize modifiers using EVIOCGKEY.
}
@@ -206,15 +205,6 @@ KeyEventConverterEvdev::~KeyEventConverterEvdev() {
close(fd_);
}
-void KeyEventConverterEvdev::Start() {
- base::MessageLoopForUI::current()->WatchFileDescriptor(
- fd_, true, base::MessagePumpLibevent::WATCH_READ, &controller_, this);
-}
-
-void KeyEventConverterEvdev::Stop() {
- controller_.StopWatchingFileDescriptor();
-}
-
void KeyEventConverterEvdev::OnFileCanReadWithoutBlocking(int fd) {
input_event inputs[4];
ssize_t read_size = read(fd, inputs, sizeof(inputs));
@@ -231,10 +221,6 @@ void KeyEventConverterEvdev::OnFileCanReadWithoutBlocking(int fd) {
ProcessEvents(inputs, read_size / sizeof(*inputs));
}
-void KeyEventConverterEvdev::OnFileCanWriteWithoutBlocking(int fd) {
- NOTREACHED();
-}
-
void KeyEventConverterEvdev::ProcessEvents(const input_event* inputs,
int count) {
for (int i = 0; i < count; ++i) {
@@ -270,7 +256,7 @@ void KeyEventConverterEvdev::ConvertKeyEvent(int key, int value) {
code,
KeycodeConverter::NativeKeycodeToCode(key + kXkbKeycodeOffset),
flags);
- DispatchEventToCallback(&key_event);
+ callback_.Run(&key_event);
}
} // namespace ui
« no previous file with comments | « ui/events/ozone/evdev/key_event_converter_evdev.h ('k') | ui/events/ozone/evdev/key_event_converter_evdev_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698