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

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

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
« no previous file with comments | « no previous file | ui/events/ozone/evdev/event_converter_evdev.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/ozone/evdev/event_converter_evdev.h
diff --git a/ui/events/ozone/evdev/event_converter_evdev.h b/ui/events/ozone/evdev/event_converter_evdev.h
index ebc36fcc5a277da0045aaf143a1ac3f74760dcc8..f2a162da18c3743ad6898aba23695f0aaac387d0 100644
--- a/ui/events/ozone/evdev/event_converter_evdev.h
+++ b/ui/events/ozone/evdev/event_converter_evdev.h
@@ -5,39 +5,43 @@
#ifndef UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_H_
#define UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_H_
-#include "base/basictypes.h"
-#include "base/bind.h"
-#include "base/memory/scoped_ptr.h"
+#include "base/callback.h"
+#include "base/files/file_path.h"
+#include "base/message_loop/message_loop.h"
#include "ui/events/ozone/evdev/events_ozone_evdev_export.h"
namespace ui {
class Event;
-class EventModifiersEvdev;
typedef base::Callback<void(Event*)> EventDispatchCallback;
-// Base class for device-specific evdev event conversion.
-class EVENTS_OZONE_EVDEV_EXPORT EventConverterEvdev {
+class EVENTS_OZONE_EVDEV_EXPORT EventConverterEvdev
+ : public base::MessagePumpLibevent::Watcher {
public:
- EventConverterEvdev();
- explicit EventConverterEvdev(const EventDispatchCallback& callback);
+ EventConverterEvdev(int fd, const base::FilePath& path);
virtual ~EventConverterEvdev();
- // Start converting events.
- virtual void Start() = 0;
+ // Start reading events.
+ void Start();
- // Stop converting events.
- virtual void Stop() = 0;
+ // Stop reading events.
+ void Stop();
protected:
- // Dispatches an event using the dispatch-callback set using
- // |SetDispatchCalback()|.
- virtual void DispatchEventToCallback(ui::Event* event);
+ // base::MessagePumpLibevent::Watcher:
+ virtual void OnFileCanWriteWithoutBlocking(int fd) OVERRIDE;
- private:
- EventDispatchCallback dispatch_callback_;
+ // File descriptor to read.
+ int fd_;
+
+ // Path to input device.
+ base::FilePath path_;
+ // Controller for watching the input fd.
+ base::MessagePumpLibevent::FileDescriptorWatcher controller_;
+
+ private:
DISALLOW_COPY_AND_ASSIGN(EventConverterEvdev);
};
« no previous file with comments | « no previous file | ui/events/ozone/evdev/event_converter_evdev.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698