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

Unified Diff: ui/events/ozone/evdev/key_event_converter.h

Issue 133233008: evdev: Move EventConverterOzone ownership from EventFactoryOzone to subclass (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: unbreak events_unittests Created 6 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
« no previous file with comments | « ui/events/ozone/evdev/event_factory.cc ('k') | ui/events/ozone/evdev/key_event_converter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/ozone/evdev/key_event_converter.h
diff --git a/ui/events/ozone/evdev/key_event_converter.h b/ui/events/ozone/evdev/key_event_converter.h
index 2a7dd6336226cd0015cdac7b327167c69f9da2b9..9aa3a3a34616e31dbcff8dc9f88032a4744a12b8 100644
--- a/ui/events/ozone/evdev/key_event_converter.h
+++ b/ui/events/ozone/evdev/key_event_converter.h
@@ -6,6 +6,7 @@
#define UI_EVENTS_OZONE_EVDEV_KEY_EVENT_CONVERTER_EVDEV_H_
#include "base/files/file_path.h"
+#include "base/message_loop/message_pump_libevent.h"
#include "ui/events/event.h"
#include "ui/events/events_export.h"
#include "ui/events/ozone/evdev/event_modifiers.h"
@@ -15,7 +16,9 @@ struct input_event;
namespace ui {
-class EVENTS_EXPORT KeyEventConverterEvdev : public EventConverterOzone {
+class EVENTS_EXPORT KeyEventConverterEvdev
+ : public EventConverterOzone,
+ base::MessagePumpLibevent::Watcher {
public:
KeyEventConverterEvdev(int fd,
base::FilePath path,
@@ -29,6 +32,10 @@ class EVENTS_EXPORT KeyEventConverterEvdev : public EventConverterOzone {
void ProcessEvents(const struct input_event* inputs, int count);
private:
+ // Start & stop watching for events.
+ void Start();
+ void Stop();
+
// File descriptor for the /dev/input/event* instance.
int fd_;
@@ -38,6 +45,9 @@ class EVENTS_EXPORT KeyEventConverterEvdev : public EventConverterOzone {
// Shared modifier state.
EventModifiersEvdev* modifiers_;
+ // Controller for watching the input fd.
+ base::MessagePumpLibevent::FileDescriptorWatcher controller_;
+
void ConvertKeyEvent(int key, int value);
DISALLOW_COPY_AND_ASSIGN(KeyEventConverterEvdev);
« no previous file with comments | « ui/events/ozone/evdev/event_factory.cc ('k') | ui/events/ozone/evdev/key_event_converter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698