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

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

Issue 545063006: ozone: evdev: Add gesture property provider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase again. Move id generation logic to EventFactoryEvdev Created 6 years, 2 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_evdev.h
diff --git a/ui/events/ozone/evdev/event_factory_evdev.h b/ui/events/ozone/evdev/event_factory_evdev.h
index 806ec2955998b1f42d1548609f72c40465396b11..ca7733b3014a3c0466ca43293c2525a200eed451 100644
--- a/ui/events/ozone/evdev/event_factory_evdev.h
+++ b/ui/events/ozone/evdev/event_factory_evdev.h
@@ -5,8 +5,11 @@
#ifndef UI_EVENTS_OZONE_EVDEV_EVENT_FACTORY_EVDEV_H_
#define UI_EVENTS_OZONE_EVDEV_EVENT_FACTORY_EVDEV_H_
+#include <set>
+
#include "base/callback.h"
#include "base/compiler_specific.h"
+#include "base/containers/hash_tables.h"
#include "base/files/file_path.h"
#include "base/memory/ref_counted.h"
#include "base/task_runner.h"
@@ -26,6 +29,10 @@ namespace ui {
class CursorDelegateEvdev;
class DeviceManager;
+#if defined(USE_EVDEV_GESTURES)
+class GesturePropertyProvider;
+#endif
+
// Ozone events implementation for the Linux input subsystem ("evdev").
class EVENTS_OZONE_EVDEV_EXPORT EventFactoryEvdev : public DeviceEventObserver,
public PlatformEventSource {
@@ -40,6 +47,9 @@ class EVENTS_OZONE_EVDEV_EXPORT EventFactoryEvdev : public DeviceEventObserver,
const gfx::PointF& location);
private:
+ // Mapping table from a device path to its device id.
+ typedef base::hash_map<base::FilePath, int> DeviceIdMap;
+
// Open device at path & starting processing events (on UI thread).
void AttachInputDevice(scoped_ptr<EventConverterEvdev> converter);
@@ -48,7 +58,9 @@ class EVENTS_OZONE_EVDEV_EXPORT EventFactoryEvdev : public DeviceEventObserver,
void NotifyHotplugEventObserver(const EventConverterEvdev& converter);
- int NextDeviceId();
+ int GenerateDeviceId(const base::FilePath& file_path);
+
+ void RevokeDeviceId(const base::FilePath& file_path);
// DeviceEventObserver overrides:
//
@@ -61,8 +73,15 @@ class EVENTS_OZONE_EVDEV_EXPORT EventFactoryEvdev : public DeviceEventObserver,
// Owned per-device event converters (by path).
std::map<base::FilePath, EventConverterEvdev*> converters_;
- // Used to uniquely identify input devices.
- int last_device_id_;
+ // An incremental counter of the next device id to be used for mapping. Used
+ // to uniquely identify input devices.
+ int device_id_counter_;
+
+ // A set of all currently used device ids.
+ std::set<int> used_device_ids_;
+
+ // Map from device paths to device ids.
+ DeviceIdMap device_ids_map_;
spang 2014/10/15 11:36:41 What is this for? I don't think you need it.
Shecky Lin 2014/10/16 04:53:53 Done.
// Interface for scanning & monitoring input devices.
DeviceManager* device_manager_; // Not owned.
@@ -76,6 +95,11 @@ class EVENTS_OZONE_EVDEV_EXPORT EventFactoryEvdev : public DeviceEventObserver,
// Cursor movement.
CursorDelegateEvdev* cursor_;
+#if defined(USE_EVDEV_GESTURES)
+ // Gesture library property provider (used by touchpads/mice).
+ scoped_ptr<GesturePropertyProvider> gesture_property_provider_;
+#endif
+
// Dispatch callback for events.
EventDispatchCallback dispatch_callback_;
« no previous file with comments | « no previous file | ui/events/ozone/evdev/event_factory_evdev.cc » ('j') | ui/events/ozone/evdev/event_factory_evdev.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698