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