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

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

Issue 250793005: Refactor Udev device support in Ozone and add a DRM hotplug monitor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 8 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/device_manager_udev.cc ('k') | ui/events/ozone/evdev/event_factory_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_factory_evdev.h
diff --git a/ui/events/ozone/evdev/event_factory_evdev.h b/ui/events/ozone/evdev/event_factory_evdev.h
index b1802fdbadf2a84696c090a978a1ad4774416b15..d35edb40fe973510ebe952d58cb808688bb2cd71 100644
--- a/ui/events/ozone/evdev/event_factory_evdev.h
+++ b/ui/events/ozone/evdev/event_factory_evdev.h
@@ -11,6 +11,7 @@
#include "base/memory/ref_counted.h"
#include "base/task_runner.h"
#include "ui/events/events_export.h"
+#include "ui/events/ozone/device/device_event_observer.h"
#include "ui/events/ozone/evdev/event_converter_evdev.h"
#include "ui/events/ozone/evdev/event_modifiers_evdev.h"
#include "ui/events/ozone/event_factory_ozone.h"
@@ -18,13 +19,15 @@
namespace ui {
class CursorDelegateEvdev;
-class DeviceManagerEvdev;
+class DeviceManager;
// Ozone events implementation for the Linux input subsystem ("evdev").
-class EVENTS_EXPORT EventFactoryEvdev : public EventFactoryOzone {
+class EVENTS_EXPORT EventFactoryEvdev
+ : public EventFactoryOzone, DeviceEventObserver {
public:
EventFactoryEvdev();
- explicit EventFactoryEvdev(CursorDelegateEvdev* cursor);
+ EventFactoryEvdev(CursorDelegateEvdev* cursor,
+ DeviceManager* device_manager);
virtual ~EventFactoryEvdev();
void DispatchUiEvent(Event* event);
@@ -44,17 +47,24 @@ class EVENTS_EXPORT EventFactoryEvdev : public EventFactoryOzone {
// Close device at path (on UI thread).
void DetachInputDevice(const base::FilePath& file_path);
+ // DeviceEventObserver overrides:
+ //
// Callback for device add (on UI thread).
- void OnDeviceAdded(const base::FilePath& path);
-
- // Callback for device remove (on UI thread).
- void OnDeviceRemoved(const base::FilePath& path);
+ virtual void OnDeviceEvent(const DeviceEvent& event) OVERRIDE;
// Owned per-device event converters (by path).
std::map<base::FilePath, EventConverterEvdev*> converters_;
// Interface for scanning & monitoring input devices.
- scoped_ptr<DeviceManagerEvdev> device_manager_;
+ DeviceManager* device_manager_; // Not owned.
+
+ // True if this was registered with |device_manager_|. This is needed since
+ // StartProcessingEvents() is called multiple times (when a
+ // WindowTreeHostOzone is created) but we shouldn't register this multiple
+ // times.
+ // TODO(dnicoara) Remove once event processing is refactored and we no longer
+ // rely on WTH for starting event processing.
+ bool has_started_processing_events_;
// Task runner for event dispatch.
scoped_refptr<base::TaskRunner> ui_task_runner_;
« no previous file with comments | « ui/events/ozone/evdev/device_manager_udev.cc ('k') | ui/events/ozone/evdev/event_factory_evdev.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698