| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_EVENTS_OZONE_EVDEV_INPUT_DEVICE_FACTORY_EVDEV_H_ | 5 #ifndef UI_EVENTS_OZONE_EVDEV_INPUT_DEVICE_FACTORY_EVDEV_H_ |
| 6 #define UI_EVENTS_OZONE_EVDEV_INPUT_DEVICE_FACTORY_EVDEV_H_ | 6 #define UI_EVENTS_OZONE_EVDEV_INPUT_DEVICE_FACTORY_EVDEV_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #error Missing dependency on ui/events/ozone:events_ozone_evdev | 27 #error Missing dependency on ui/events/ozone:events_ozone_evdev |
| 28 #endif | 28 #endif |
| 29 | 29 |
| 30 #if defined(USE_EVDEV_GESTURES) | 30 #if defined(USE_EVDEV_GESTURES) |
| 31 class GesturePropertyProvider; | 31 class GesturePropertyProvider; |
| 32 #endif | 32 #endif |
| 33 | 33 |
| 34 // Manager for event device objects. All device I/O starts here. | 34 // Manager for event device objects. All device I/O starts here. |
| 35 class EVENTS_OZONE_EVDEV_EXPORT InputDeviceFactoryEvdev { | 35 class EVENTS_OZONE_EVDEV_EXPORT InputDeviceFactoryEvdev { |
| 36 public: | 36 public: |
| 37 InputDeviceFactoryEvdev( | 37 InputDeviceFactoryEvdev(scoped_ptr<DeviceEventDispatcherEvdev> dispatcher, |
| 38 DeviceEventDispatcherEvdev* dispatcher, | 38 CursorDelegateEvdev* cursor); |
| 39 scoped_refptr<base::SingleThreadTaskRunner> dispatch_runner, | |
| 40 CursorDelegateEvdev* cursor); | |
| 41 ~InputDeviceFactoryEvdev(); | 39 ~InputDeviceFactoryEvdev(); |
| 42 | 40 |
| 43 // Open & start reading a newly plugged-in input device. | 41 // Open & start reading a newly plugged-in input device. |
| 44 void AddInputDevice(int id, const base::FilePath& path); | 42 void AddInputDevice(int id, const base::FilePath& path); |
| 45 | 43 |
| 46 // Stop reading & close an unplugged input device. | 44 // Stop reading & close an unplugged input device. |
| 47 void RemoveInputDevice(const base::FilePath& path); | 45 void RemoveInputDevice(const base::FilePath& path); |
| 48 | 46 |
| 49 // Disables the internal touchpad. | 47 // Disables the internal touchpad. |
| 50 void DisableInternalTouchpad(); | 48 void DisableInternalTouchpad(); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 void SetIntPropertyForOneType(const EventDeviceType type, | 83 void SetIntPropertyForOneType(const EventDeviceType type, |
| 86 const std::string& name, | 84 const std::string& name, |
| 87 int value); | 85 int value); |
| 88 void SetBoolPropertyForOneType(const EventDeviceType type, | 86 void SetBoolPropertyForOneType(const EventDeviceType type, |
| 89 const std::string& name, | 87 const std::string& name, |
| 90 bool value); | 88 bool value); |
| 91 | 89 |
| 92 // Owned per-device event converters (by path). | 90 // Owned per-device event converters (by path). |
| 93 std::map<base::FilePath, EventConverterEvdev*> converters_; | 91 std::map<base::FilePath, EventConverterEvdev*> converters_; |
| 94 | 92 |
| 95 // Task runner for event dispatch. | 93 // Task runner for our thread. |
| 96 scoped_refptr<base::TaskRunner> ui_task_runner_; | 94 scoped_refptr<base::TaskRunner> task_runner_; |
| 97 | 95 |
| 98 // Cursor movement. | 96 // Cursor movement. |
| 99 CursorDelegateEvdev* cursor_; | 97 CursorDelegateEvdev* cursor_; |
| 100 | 98 |
| 101 #if defined(USE_EVDEV_GESTURES) | 99 #if defined(USE_EVDEV_GESTURES) |
| 102 // Gesture library property provider (used by touchpads/mice). | 100 // Gesture library property provider (used by touchpads/mice). |
| 103 scoped_ptr<GesturePropertyProvider> gesture_property_provider_; | 101 scoped_ptr<GesturePropertyProvider> gesture_property_provider_; |
| 104 #endif | 102 #endif |
| 105 | 103 |
| 106 // Dispatcher for events. | 104 // Dispatcher for events. |
| 107 DeviceEventDispatcherEvdev* dispatcher_; | 105 scoped_ptr<DeviceEventDispatcherEvdev> dispatcher_; |
| 108 | 106 |
| 109 // Support weak pointers for attach & detach callbacks. | 107 // Support weak pointers for attach & detach callbacks. |
| 110 base::WeakPtrFactory<InputDeviceFactoryEvdev> weak_ptr_factory_; | 108 base::WeakPtrFactory<InputDeviceFactoryEvdev> weak_ptr_factory_; |
| 111 | 109 |
| 112 DISALLOW_COPY_AND_ASSIGN(InputDeviceFactoryEvdev); | 110 DISALLOW_COPY_AND_ASSIGN(InputDeviceFactoryEvdev); |
| 113 }; | 111 }; |
| 114 | 112 |
| 115 } // namespace ui | 113 } // namespace ui |
| 116 | 114 |
| 117 #endif // UI_EVENTS_OZONE_EVDEV_INPUT_DEVICE_FACTORY_EVDEV_H_ | 115 #endif // UI_EVENTS_OZONE_EVDEV_INPUT_DEVICE_FACTORY_EVDEV_H_ |
| OLD | NEW |