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

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: add TODOs 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_device_info.cc ('k') | ui/events/ozone/evdev/event_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..2bcda41063a73611932ae793e73b3b942fe12f88 100644
--- a/ui/events/ozone/evdev/event_factory.h
+++ b/ui/events/ozone/evdev/event_factory.h
@@ -5,6 +5,7 @@
#ifndef UI_EVENTS_OZONE_EVENT_FACTORY_DELEGATE_EVDEV_H_
#define UI_EVENTS_OZONE_EVENT_FACTORY_DELEGATE_EVDEV_H_
+#include "base/callback.h"
#include "base/compiler_specific.h"
#include "base/files/file_path.h"
#include "ui/events/events_export.h"
@@ -12,12 +13,22 @@
#include "ui/events/ozone/evdev/event_modifiers.h"
#include "ui/events/ozone/event_factory_ozone.h"
-#if defined(USE_UDEV)
-#include "ui/events/ozone/evdev/scoped_udev.h"
-#endif
-
namespace ui {
+typedef base::Callback<void(const base::FilePath& file_path)>
+ EvdevDeviceCallback;
+
+// Interface for scanning & monitoring input devices.
+class DeviceManagerEvdev {
+ public:
+ virtual ~DeviceManagerEvdev();
+
+ // Enumerate devices & start watching for changes.
+ virtual void ScanAndStartMonitoring(
+ const EvdevDeviceCallback& device_added,
+ const EvdevDeviceCallback& device_removed) = 0;
+};
+
// Ozone events implementation for the Linux input subsystem ("evdev").
class EVENTS_EXPORT EventFactoryEvdev : public EventFactoryOzone {
public:
@@ -30,21 +41,14 @@ class EVENTS_EXPORT EventFactoryEvdev : public EventFactoryOzone {
// Open device at path & starting processing events.
void AttachInputDevice(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();
-#endif
+ // Close device at path.
+ void DetachInputDevice(const base::FilePath& file_path);
// Owned per-device event converters (by path).
std::map<base::FilePath, EventConverterEvdev*> converters_;
-#if defined(USE_UDEV)
- // Udev daemon connection.
- scoped_udev udev_;
-#endif
+ // Interface for scanning & monitoring input devices.
+ scoped_ptr<DeviceManagerEvdev> device_manager_;
EventModifiersEvdev modifiers_;
« no previous file with comments | « ui/events/ozone/evdev/event_device_info.cc ('k') | ui/events/ozone/evdev/event_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698