| 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 struct InputDeviceSettingsEvdev; | 22 struct InputDeviceSettingsEvdev; |
| 22 | 23 |
| 23 typedef base::Callback<void(scoped_ptr<std::string>)> GetTouchDeviceStatusReply; | 24 typedef base::Callback<void(scoped_ptr<std::string>)> GetTouchDeviceStatusReply; |
| 25 typedef base::Callback<void(scoped_ptr<std::vector<base::FilePath>>)> |
| 26 GetTouchEventLogReply; |
| 24 | 27 |
| 25 // Thread safe proxy for InputDeviceFactoryEvdev. | 28 // Thread safe proxy for InputDeviceFactoryEvdev. |
| 26 // | 29 // |
| 27 // This is used on the UI thread to proxy calls to the real object on | 30 // This is used on the UI thread to proxy calls to the real object on |
| 28 // the device I/O thread. | 31 // the device I/O thread. |
| 29 class EVENTS_OZONE_EVDEV_EXPORT InputDeviceFactoryEvdevProxy { | 32 class EVENTS_OZONE_EVDEV_EXPORT InputDeviceFactoryEvdevProxy { |
| 30 public: | 33 public: |
| 31 InputDeviceFactoryEvdevProxy( | 34 InputDeviceFactoryEvdevProxy( |
| 32 scoped_refptr<base::SingleThreadTaskRunner> task_runner, | 35 scoped_refptr<base::SingleThreadTaskRunner> task_runner, |
| 33 base::WeakPtr<InputDeviceFactoryEvdev> input_device_factory); | 36 base::WeakPtr<InputDeviceFactoryEvdev> input_device_factory); |
| 34 ~InputDeviceFactoryEvdevProxy(); | 37 ~InputDeviceFactoryEvdevProxy(); |
| 35 | 38 |
| 36 // See InputDeviceFactoryEvdev for docs. These calls simply forward to | 39 // See InputDeviceFactoryEvdev for docs. These calls simply forward to |
| 37 // that object on another thread. | 40 // that object on another thread. |
| 38 void AddInputDevice(int id, const base::FilePath& path); | 41 void AddInputDevice(int id, const base::FilePath& path); |
| 39 void RemoveInputDevice(const base::FilePath& path); | 42 void RemoveInputDevice(const base::FilePath& path); |
| 40 void DisableInternalTouchpad(); | 43 void DisableInternalTouchpad(); |
| 41 void EnableInternalTouchpad(); | 44 void EnableInternalTouchpad(); |
| 42 void DisableInternalKeyboardExceptKeys( | 45 void DisableInternalKeyboardExceptKeys( |
| 43 scoped_ptr<std::set<DomCode>> excepted_keys); | 46 scoped_ptr<std::set<DomCode>> excepted_keys); |
| 44 void EnableInternalKeyboard(); | 47 void EnableInternalKeyboard(); |
| 45 void UpdateInputDeviceSettings(const InputDeviceSettingsEvdev& settings); | 48 void UpdateInputDeviceSettings(const InputDeviceSettingsEvdev& settings); |
| 46 void GetTouchDeviceStatus(const GetTouchDeviceStatusReply& reply); | 49 void GetTouchDeviceStatus(const GetTouchDeviceStatusReply& reply); |
| 50 void GetTouchEventLog(const base::FilePath& out_dir, |
| 51 const GetTouchEventLogReply& reply); |
| 47 | 52 |
| 48 private: | 53 private: |
| 49 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 54 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 50 base::WeakPtr<InputDeviceFactoryEvdev> input_device_factory_; | 55 base::WeakPtr<InputDeviceFactoryEvdev> input_device_factory_; |
| 51 | 56 |
| 52 DISALLOW_COPY_AND_ASSIGN(InputDeviceFactoryEvdevProxy); | 57 DISALLOW_COPY_AND_ASSIGN(InputDeviceFactoryEvdevProxy); |
| 53 }; | 58 }; |
| 54 | 59 |
| 55 } // namespace ui | 60 } // namespace ui |
| 56 | 61 |
| 57 #endif // UI_EVENTS_OZONE_EVDEV_INPUT_DEVICE_FACTORY_PROXY_EVDEV_H_ | 62 #endif // UI_EVENTS_OZONE_EVDEV_INPUT_DEVICE_FACTORY_PROXY_EVDEV_H_ |
| OLD | NEW |