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 | 21 |
22 typedef base::Callback<void(scoped_ptr<std::string>)> GetTouchDeviceStatusReply; | 22 typedef base::Callback<void(scoped_ptr<std::string>)> GetTouchDeviceStatusReply; |
23 | 23 |
24 // Thread safe proxy for InputDeviceFactoryEvdev. | 24 // Thread safe proxy for InputDeviceFactoryEvdev. |
| 25 // |
| 26 // This is used on the UI thread to proxy calls to the real object on |
| 27 // the device I/O thread. |
25 class EVENTS_OZONE_EVDEV_EXPORT InputDeviceFactoryEvdevProxy { | 28 class EVENTS_OZONE_EVDEV_EXPORT InputDeviceFactoryEvdevProxy { |
26 public: | 29 public: |
27 InputDeviceFactoryEvdevProxy( | 30 InputDeviceFactoryEvdevProxy( |
28 scoped_refptr<base::SingleThreadTaskRunner> task_runner, | 31 scoped_refptr<base::SingleThreadTaskRunner> task_runner, |
29 base::WeakPtr<InputDeviceFactoryEvdev> input_device_factory); | 32 base::WeakPtr<InputDeviceFactoryEvdev> input_device_factory); |
30 ~InputDeviceFactoryEvdevProxy(); | 33 ~InputDeviceFactoryEvdevProxy(); |
31 | 34 |
32 // See InputDeviceFactoryEvdev for docs. These calls simply forward to | 35 // See InputDeviceFactoryEvdev for docs. These calls simply forward to |
33 // that object on another thread. | 36 // that object on another thread. |
34 void AddInputDevice(int id, const base::FilePath& path); | 37 void AddInputDevice(int id, const base::FilePath& path); |
(...skipping 15 matching lines...) Expand all Loading... |
50 private: | 53 private: |
51 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 54 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
52 base::WeakPtr<InputDeviceFactoryEvdev> input_device_factory_; | 55 base::WeakPtr<InputDeviceFactoryEvdev> input_device_factory_; |
53 | 56 |
54 DISALLOW_COPY_AND_ASSIGN(InputDeviceFactoryEvdevProxy); | 57 DISALLOW_COPY_AND_ASSIGN(InputDeviceFactoryEvdevProxy); |
55 }; | 58 }; |
56 | 59 |
57 } // namespace ui | 60 } // namespace ui |
58 | 61 |
59 #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 |