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> |
11 | 11 |
12 #include "base/callback.h" | 12 #include "base/callback.h" |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
16 #include "base/task_runner.h" | 16 #include "base/task_runner.h" |
17 #include "ui/events/ozone/evdev/event_converter_evdev.h" | 17 #include "ui/events/ozone/evdev/event_converter_evdev.h" |
18 #include "ui/events/ozone/evdev/event_device_info.h" | 18 #include "ui/events/ozone/evdev/event_device_info.h" |
19 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h" | 19 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h" |
20 | 20 |
21 namespace ui { | 21 namespace ui { |
22 | 22 |
23 class CursorDelegateEvdev; | 23 class CursorDelegateEvdev; |
24 class DeviceEventDispatcherEvdev; | 24 class DeviceEventDispatcherEvdev; |
| 25 class InputDeviceFactoryProxyEvdev; |
25 | 26 |
26 #if !defined(USE_EVDEV) | 27 #if !defined(USE_EVDEV) |
27 #error Missing dependency on ui/events/ozone:events_ozone_evdev | 28 #error Missing dependency on ui/events/ozone:events_ozone_evdev |
28 #endif | 29 #endif |
29 | 30 |
30 #if defined(USE_EVDEV_GESTURES) | 31 #if defined(USE_EVDEV_GESTURES) |
31 class GesturePropertyProvider; | 32 class GesturePropertyProvider; |
32 #endif | 33 #endif |
33 | 34 |
34 // Manager for event device objects. All device I/O starts here. | 35 // Manager for event device objects. All device I/O starts here. |
(...skipping 24 matching lines...) Expand all Loading... |
59 | 60 |
60 // Bits from InputController that have to be answered on IO. | 61 // Bits from InputController that have to be answered on IO. |
61 void SetTouchpadSensitivity(int value); | 62 void SetTouchpadSensitivity(int value); |
62 void SetTapToClick(bool enabled); | 63 void SetTapToClick(bool enabled); |
63 void SetThreeFingerClick(bool enabled); | 64 void SetThreeFingerClick(bool enabled); |
64 void SetTapDragging(bool enabled); | 65 void SetTapDragging(bool enabled); |
65 void SetNaturalScroll(bool enabled); | 66 void SetNaturalScroll(bool enabled); |
66 void SetMouseSensitivity(int value); | 67 void SetMouseSensitivity(int value); |
67 void SetTapToClickPaused(bool state); | 68 void SetTapToClickPaused(bool state); |
68 | 69 |
| 70 base::WeakPtr<InputDeviceFactoryEvdev> GetWeakPtr(); |
| 71 |
69 private: | 72 private: |
70 // Open device at path & starting processing events (on UI thread). | 73 // Open device at path & starting processing events (on UI thread). |
71 void AttachInputDevice(scoped_ptr<EventConverterEvdev> converter); | 74 void AttachInputDevice(scoped_ptr<EventConverterEvdev> converter); |
72 | 75 |
73 // Close device at path (on UI thread). | 76 // Close device at path (on UI thread). |
74 void DetachInputDevice(const base::FilePath& file_path); | 77 void DetachInputDevice(const base::FilePath& file_path); |
75 | 78 |
76 // Update observers on device changes. | 79 // Update observers on device changes. |
77 void NotifyDeviceChange(const EventConverterEvdev& converter); | 80 void NotifyDeviceChange(const EventConverterEvdev& converter); |
78 void NotifyKeyboardsUpdated(); | 81 void NotifyKeyboardsUpdated(); |
(...skipping 27 matching lines...) Expand all Loading... |
106 | 109 |
107 // Support weak pointers for attach & detach callbacks. | 110 // Support weak pointers for attach & detach callbacks. |
108 base::WeakPtrFactory<InputDeviceFactoryEvdev> weak_ptr_factory_; | 111 base::WeakPtrFactory<InputDeviceFactoryEvdev> weak_ptr_factory_; |
109 | 112 |
110 DISALLOW_COPY_AND_ASSIGN(InputDeviceFactoryEvdev); | 113 DISALLOW_COPY_AND_ASSIGN(InputDeviceFactoryEvdev); |
111 }; | 114 }; |
112 | 115 |
113 } // namespace ui | 116 } // namespace ui |
114 | 117 |
115 #endif // UI_EVENTS_OZONE_EVDEV_INPUT_DEVICE_FACTORY_EVDEV_H_ | 118 #endif // UI_EVENTS_OZONE_EVDEV_INPUT_DEVICE_FACTORY_EVDEV_H_ |
OLD | NEW |