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_PROXY_EVDEV_H_ | 5 #ifndef UI_EVENTS_OZONE_EVDEV_INPUT_DEVICE_FACTORY_PROXY_EVDEV_H_ |
6 #define UI_EVENTS_OZONE_EVDEV_INPUT_DEVICE_FACTORY_PROXY_EVDEV_H_ | 6 #define UI_EVENTS_OZONE_EVDEV_INPUT_DEVICE_FACTORY_PROXY_EVDEV_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "base/single_thread_task_runner.h" | 14 #include "base/single_thread_task_runner.h" |
15 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h" | 15 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h" |
16 | 16 |
17 namespace ui { | 17 namespace ui { |
18 | 18 |
19 enum class DomCode; | 19 enum class DomCode; |
20 class InputDeviceFactoryEvdev; | 20 class InputDeviceFactoryEvdev; |
| 21 struct InputDeviceSettingsEvdev; |
21 | 22 |
22 typedef base::Callback<void(scoped_ptr<std::string>)> GetTouchDeviceStatusReply; | 23 typedef base::Callback<void(scoped_ptr<std::string>)> GetTouchDeviceStatusReply; |
23 | 24 |
24 // Thread safe proxy for InputDeviceFactoryEvdev. | 25 // Thread safe proxy for InputDeviceFactoryEvdev. |
25 // | 26 // |
26 // This is used on the UI thread to proxy calls to the real object on | 27 // This is used on the UI thread to proxy calls to the real object on |
27 // the device I/O thread. | 28 // the device I/O thread. |
28 class EVENTS_OZONE_EVDEV_EXPORT InputDeviceFactoryEvdevProxy { | 29 class EVENTS_OZONE_EVDEV_EXPORT InputDeviceFactoryEvdevProxy { |
29 public: | 30 public: |
30 InputDeviceFactoryEvdevProxy( | 31 InputDeviceFactoryEvdevProxy( |
31 scoped_refptr<base::SingleThreadTaskRunner> task_runner, | 32 scoped_refptr<base::SingleThreadTaskRunner> task_runner, |
32 base::WeakPtr<InputDeviceFactoryEvdev> input_device_factory); | 33 base::WeakPtr<InputDeviceFactoryEvdev> input_device_factory); |
33 ~InputDeviceFactoryEvdevProxy(); | 34 ~InputDeviceFactoryEvdevProxy(); |
34 | 35 |
35 // See InputDeviceFactoryEvdev for docs. These calls simply forward to | 36 // See InputDeviceFactoryEvdev for docs. These calls simply forward to |
36 // that object on another thread. | 37 // that object on another thread. |
37 void AddInputDevice(int id, const base::FilePath& path); | 38 void AddInputDevice(int id, const base::FilePath& path); |
38 void RemoveInputDevice(const base::FilePath& path); | 39 void RemoveInputDevice(const base::FilePath& path); |
39 void DisableInternalTouchpad(); | 40 void DisableInternalTouchpad(); |
40 void EnableInternalTouchpad(); | 41 void EnableInternalTouchpad(); |
41 void DisableInternalKeyboardExceptKeys( | 42 void DisableInternalKeyboardExceptKeys( |
42 scoped_ptr<std::set<DomCode>> excepted_keys); | 43 scoped_ptr<std::set<DomCode>> excepted_keys); |
43 void EnableInternalKeyboard(); | 44 void EnableInternalKeyboard(); |
44 void SetTouchpadSensitivity(int value); | 45 void UpdateInputDeviceSettings(const InputDeviceSettingsEvdev& settings); |
45 void SetTapToClick(bool enabled); | |
46 void SetThreeFingerClick(bool enabled); | |
47 void SetTapDragging(bool enabled); | |
48 void SetNaturalScroll(bool enabled); | |
49 void SetMouseSensitivity(int value); | |
50 void SetTapToClickPaused(bool state); | |
51 void GetTouchDeviceStatus(const GetTouchDeviceStatusReply& reply); | 46 void GetTouchDeviceStatus(const GetTouchDeviceStatusReply& reply); |
52 | 47 |
53 private: | 48 private: |
54 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 49 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
55 base::WeakPtr<InputDeviceFactoryEvdev> input_device_factory_; | 50 base::WeakPtr<InputDeviceFactoryEvdev> input_device_factory_; |
56 | 51 |
57 DISALLOW_COPY_AND_ASSIGN(InputDeviceFactoryEvdevProxy); | 52 DISALLOW_COPY_AND_ASSIGN(InputDeviceFactoryEvdevProxy); |
58 }; | 53 }; |
59 | 54 |
60 } // namespace ui | 55 } // namespace ui |
61 | 56 |
62 #endif // UI_EVENTS_OZONE_EVDEV_INPUT_DEVICE_FACTORY_PROXY_EVDEV_H_ | 57 #endif // UI_EVENTS_OZONE_EVDEV_INPUT_DEVICE_FACTORY_PROXY_EVDEV_H_ |
OLD | NEW |