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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 // Enables the internal touchpad. | 56 // Enables the internal touchpad. |
57 void EnableInternalTouchpad(); | 57 void EnableInternalTouchpad(); |
58 | 58 |
59 // Disables all keys on the internal keyboard except |excepted_keys|. | 59 // Disables all keys on the internal keyboard except |excepted_keys|. |
60 void DisableInternalKeyboardExceptKeys( | 60 void DisableInternalKeyboardExceptKeys( |
61 scoped_ptr<std::set<DomCode>> excepted_keys); | 61 scoped_ptr<std::set<DomCode>> excepted_keys); |
62 | 62 |
63 // Enables all keys on the internal keyboard. | 63 // Enables all keys on the internal keyboard. |
64 void EnableInternalKeyboard(); | 64 void EnableInternalKeyboard(); |
65 | 65 |
| 66 // LED state. |
| 67 void SetCapsLockLed(bool enabled); |
| 68 |
66 // Bits from InputController that have to be answered on IO. | 69 // Bits from InputController that have to be answered on IO. |
67 void UpdateInputDeviceSettings(const InputDeviceSettingsEvdev& settings); | 70 void UpdateInputDeviceSettings(const InputDeviceSettingsEvdev& settings); |
68 void GetTouchDeviceStatus(const GetTouchDeviceStatusReply& reply); | 71 void GetTouchDeviceStatus(const GetTouchDeviceStatusReply& reply); |
69 void GetTouchEventLog(const base::FilePath& out_dir, | 72 void GetTouchEventLog(const base::FilePath& out_dir, |
70 const GetTouchEventLogReply& reply); | 73 const GetTouchEventLogReply& reply); |
71 | 74 |
72 base::WeakPtr<InputDeviceFactoryEvdev> GetWeakPtr(); | 75 base::WeakPtr<InputDeviceFactoryEvdev> GetWeakPtr(); |
73 | 76 |
74 private: | 77 private: |
75 // Open device at path & starting processing events (on UI thread). | 78 // Open device at path & starting processing events (on UI thread). |
76 void AttachInputDevice(scoped_ptr<EventConverterEvdev> converter); | 79 void AttachInputDevice(scoped_ptr<EventConverterEvdev> converter); |
77 | 80 |
78 // Close device at path (on UI thread). | 81 // Close device at path (on UI thread). |
79 void DetachInputDevice(const base::FilePath& file_path); | 82 void DetachInputDevice(const base::FilePath& file_path); |
80 | 83 |
81 // Sync input_device_settings_ to attached devices. | 84 // Sync input_device_settings_ to attached devices. |
82 void ApplyInputDeviceSettings(); | 85 void ApplyInputDeviceSettings(); |
| 86 void ApplyCapsLockLed(); |
83 | 87 |
84 // Update observers on device changes. | 88 // Update observers on device changes. |
85 void UpdateDirtyFlags(const EventConverterEvdev* converter); | 89 void UpdateDirtyFlags(const EventConverterEvdev* converter); |
86 void NotifyDevicesUpdated(); | 90 void NotifyDevicesUpdated(); |
87 void NotifyKeyboardsUpdated(); | 91 void NotifyKeyboardsUpdated(); |
88 void NotifyTouchscreensUpdated(); | 92 void NotifyTouchscreensUpdated(); |
89 void NotifyMouseDevicesUpdated(); | 93 void NotifyMouseDevicesUpdated(); |
90 void NotifyTouchpadDevicesUpdated(); | 94 void NotifyTouchpadDevicesUpdated(); |
91 | 95 |
92 void SetIntPropertyForOneType(const EventDeviceType type, | 96 void SetIntPropertyForOneType(const EventDeviceType type, |
(...skipping 20 matching lines...) Expand all Loading... |
113 // Dispatcher for events. | 117 // Dispatcher for events. |
114 scoped_ptr<DeviceEventDispatcherEvdev> dispatcher_; | 118 scoped_ptr<DeviceEventDispatcherEvdev> dispatcher_; |
115 | 119 |
116 // Number of pending device additions & device classes. | 120 // Number of pending device additions & device classes. |
117 int pending_device_changes_; | 121 int pending_device_changes_; |
118 bool touchscreen_list_dirty_; | 122 bool touchscreen_list_dirty_; |
119 bool keyboard_list_dirty_; | 123 bool keyboard_list_dirty_; |
120 bool mouse_list_dirty_; | 124 bool mouse_list_dirty_; |
121 bool touchpad_list_dirty_; | 125 bool touchpad_list_dirty_; |
122 | 126 |
| 127 // LEDs. |
| 128 bool caps_lock_led_enabled_; |
| 129 |
123 // Device settings. These primarily affect libgestures behavior. | 130 // Device settings. These primarily affect libgestures behavior. |
124 InputDeviceSettingsEvdev input_device_settings_; | 131 InputDeviceSettingsEvdev input_device_settings_; |
125 | 132 |
126 // Support weak pointers for attach & detach callbacks. | 133 // Support weak pointers for attach & detach callbacks. |
127 base::WeakPtrFactory<InputDeviceFactoryEvdev> weak_ptr_factory_; | 134 base::WeakPtrFactory<InputDeviceFactoryEvdev> weak_ptr_factory_; |
128 | 135 |
129 DISALLOW_COPY_AND_ASSIGN(InputDeviceFactoryEvdev); | 136 DISALLOW_COPY_AND_ASSIGN(InputDeviceFactoryEvdev); |
130 }; | 137 }; |
131 | 138 |
132 } // namespace ui | 139 } // namespace ui |
133 | 140 |
134 #endif // UI_EVENTS_OZONE_EVDEV_INPUT_DEVICE_FACTORY_EVDEV_H_ | 141 #endif // UI_EVENTS_OZONE_EVDEV_INPUT_DEVICE_FACTORY_EVDEV_H_ |
OLD | NEW |