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

Side by Side Diff: ui/events/ozone/evdev/input_device_factory_evdev.h

Issue 956793002: ozone: evdev: Keep track of settings & apply to new devices (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2311
Patch Set: Created 5 years, 9 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 unified diff | Download patch
OLDNEW
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 #include "ui/events/ozone/evdev/input_device_settings_evdev.h"
20 21
21 namespace ui { 22 namespace ui {
22 23
23 class CursorDelegateEvdev; 24 class CursorDelegateEvdev;
24 class DeviceEventDispatcherEvdev; 25 class DeviceEventDispatcherEvdev;
25 class InputDeviceFactoryEvdevProxy; 26 class InputDeviceFactoryEvdevProxy;
26 27
27 #if !defined(USE_EVDEV) 28 #if !defined(USE_EVDEV)
28 #error Missing dependency on ui/events/ozone:events_ozone_evdev 29 #error Missing dependency on ui/events/ozone:events_ozone_evdev
29 #endif 30 #endif
(...skipping 24 matching lines...) Expand all
54 void EnableInternalTouchpad(); 55 void EnableInternalTouchpad();
55 56
56 // Disables all keys on the internal keyboard except |excepted_keys|. 57 // Disables all keys on the internal keyboard except |excepted_keys|.
57 void DisableInternalKeyboardExceptKeys( 58 void DisableInternalKeyboardExceptKeys(
58 scoped_ptr<std::set<DomCode>> excepted_keys); 59 scoped_ptr<std::set<DomCode>> excepted_keys);
59 60
60 // Enables all keys on the internal keyboard. 61 // Enables all keys on the internal keyboard.
61 void EnableInternalKeyboard(); 62 void EnableInternalKeyboard();
62 63
63 // Bits from InputController that have to be answered on IO. 64 // Bits from InputController that have to be answered on IO.
64 void SetTouchpadSensitivity(int value); 65 void UpdateInputDeviceSettings(const InputDeviceSettingsEvdev& settings);
65 void SetTapToClick(bool enabled);
66 void SetThreeFingerClick(bool enabled);
67 void SetTapDragging(bool enabled);
68 void SetNaturalScroll(bool enabled);
69 void SetMouseSensitivity(int value);
70 void SetTapToClickPaused(bool state);
71 void GetTouchDeviceStatus(const GetTouchDeviceStatusReply& reply); 66 void GetTouchDeviceStatus(const GetTouchDeviceStatusReply& reply);
72 67
73 base::WeakPtr<InputDeviceFactoryEvdev> GetWeakPtr(); 68 base::WeakPtr<InputDeviceFactoryEvdev> GetWeakPtr();
74 69
75 private: 70 private:
76 // Open device at path & starting processing events (on UI thread). 71 // Open device at path & starting processing events (on UI thread).
77 void AttachInputDevice(scoped_ptr<EventConverterEvdev> converter); 72 void AttachInputDevice(scoped_ptr<EventConverterEvdev> converter);
78 73
79 // Close device at path (on UI thread). 74 // Close device at path (on UI thread).
80 void DetachInputDevice(const base::FilePath& file_path); 75 void DetachInputDevice(const base::FilePath& file_path);
81 76
77 // Sync input_device_settings_ to attached devices.
78 void ApplyInputDeviceSettings();
79
82 // Update observers on device changes. 80 // Update observers on device changes.
83 void UpdateDirtyFlags(const EventConverterEvdev* converter); 81 void UpdateDirtyFlags(const EventConverterEvdev* converter);
84 void NotifyDevicesUpdated(); 82 void NotifyDevicesUpdated();
85 void NotifyKeyboardsUpdated(); 83 void NotifyKeyboardsUpdated();
86 void NotifyTouchscreensUpdated(); 84 void NotifyTouchscreensUpdated();
87 void NotifyMouseDevicesUpdated(); 85 void NotifyMouseDevicesUpdated();
88 void NotifyTouchpadDevicesUpdated(); 86 void NotifyTouchpadDevicesUpdated();
89 87
90 void SetIntPropertyForOneType(const EventDeviceType type, 88 void SetIntPropertyForOneType(const EventDeviceType type,
91 const std::string& name, 89 const std::string& name,
(...skipping 19 matching lines...) Expand all
111 // Dispatcher for events. 109 // Dispatcher for events.
112 scoped_ptr<DeviceEventDispatcherEvdev> dispatcher_; 110 scoped_ptr<DeviceEventDispatcherEvdev> dispatcher_;
113 111
114 // Number of pending device additions & device classes. 112 // Number of pending device additions & device classes.
115 int pending_device_changes_; 113 int pending_device_changes_;
116 bool touchscreen_list_dirty_; 114 bool touchscreen_list_dirty_;
117 bool keyboard_list_dirty_; 115 bool keyboard_list_dirty_;
118 bool mouse_list_dirty_; 116 bool mouse_list_dirty_;
119 bool touchpad_list_dirty_; 117 bool touchpad_list_dirty_;
120 118
119 // Device settings. These primarily affect libgestures behavior.
120 InputDeviceSettingsEvdev input_device_settings_;
121
121 // Support weak pointers for attach & detach callbacks. 122 // Support weak pointers for attach & detach callbacks.
122 base::WeakPtrFactory<InputDeviceFactoryEvdev> weak_ptr_factory_; 123 base::WeakPtrFactory<InputDeviceFactoryEvdev> weak_ptr_factory_;
123 124
124 DISALLOW_COPY_AND_ASSIGN(InputDeviceFactoryEvdev); 125 DISALLOW_COPY_AND_ASSIGN(InputDeviceFactoryEvdev);
125 }; 126 };
126 127
127 } // namespace ui 128 } // namespace ui
128 129
129 #endif // UI_EVENTS_OZONE_EVDEV_INPUT_DEVICE_FACTORY_EVDEV_H_ 130 #endif // UI_EVENTS_OZONE_EVDEV_INPUT_DEVICE_FACTORY_EVDEV_H_
OLDNEW
« no previous file with comments | « ui/events/ozone/evdev/input_controller_evdev.cc ('k') | ui/events/ozone/evdev/input_device_factory_evdev.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698