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

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

Issue 150633005: evdev: Support device hotplug with udev (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fewer memory leaks 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
Index: ui/events/ozone/evdev/event_factory.h
diff --git a/ui/events/ozone/evdev/event_factory.h b/ui/events/ozone/evdev/event_factory.h
index a0fbbe46b176d44a8e236573a4dd9710c5e0a6cb..210a2746f313b43ceaf0ab1386b4b2ede0cf4dc2 100644
--- a/ui/events/ozone/evdev/event_factory.h
+++ b/ui/events/ozone/evdev/event_factory.h
@@ -7,6 +7,7 @@
#include "base/compiler_specific.h"
#include "base/files/file_path.h"
+#include "base/message_loop/message_pump_libevent.h"
#include "ui/events/events_export.h"
#include "ui/events/ozone/evdev/event_converter.h"
#include "ui/events/ozone/evdev/event_modifiers.h"
@@ -18,6 +19,10 @@
namespace ui {
+#if defined(USE_UDEV)
+class UdevWatcher;
+#endif
+
// Ozone events implementation for the Linux input subsystem ("evdev").
class EVENTS_EXPORT EventFactoryEvdev : public EventFactoryOzone {
public:
@@ -30,12 +35,18 @@ class EVENTS_EXPORT EventFactoryEvdev : public EventFactoryOzone {
// Open device at path & starting processing events.
void AttachInputDevice(const base::FilePath& file_path);
+ // Close device at path.
+ void DetachInputDevice(const base::FilePath& file_path);
+
// Scan & open devices in /dev/input (without udev).
void StartProcessingEventsManual();
#if defined(USE_UDEV)
// Scan & open devices using udev.
void StartProcessingEventsUdev();
+
+ // Set up device monitor for hotplug.
+ bool StartMonitoringDevicesUdev();
#endif
// Owned per-device event converters (by path).
@@ -44,6 +55,12 @@ class EVENTS_EXPORT EventFactoryEvdev : public EventFactoryOzone {
#if defined(USE_UDEV)
// Udev daemon connection.
scoped_udev udev_;
+
+ // Udev device change monitor.
+ scoped_udev_monitor udev_monitor_;
+
+ // Watcher for uevent netlink socket.
+ scoped_ptr<UdevWatcher> watcher_;
sadrul 2014/01/30 22:10:36 Can there a be single scoped_ptr<UdevController> t
rjkroege 2014/01/30 22:18:09 +1
spang 2014/01/31 17:33:00 Done.
#endif
EventModifiersEvdev modifiers_;

Powered by Google App Engine
This is Rietveld 408576698