Supervised user whitelists: Cleanup
[chromium-blink-merge.git] / ui / events / ozone / evdev / input_device_factory_evdev_proxy.h
blob3cabdc4e64b6b96a57251fcbe6b57d36f23add3a
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
3 // found in the LICENSE file.
5 #ifndef UI_EVENTS_OZONE_EVDEV_INPUT_DEVICE_FACTORY_PROXY_EVDEV_H_
6 #define UI_EVENTS_OZONE_EVDEV_INPUT_DEVICE_FACTORY_PROXY_EVDEV_H_
8 #include <set>
9 #include <vector>
11 #include "base/compiler_specific.h"
12 #include "base/files/file_path.h"
13 #include "base/memory/ref_counted.h"
14 #include "base/memory/weak_ptr.h"
15 #include "base/single_thread_task_runner.h"
16 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h"
18 namespace ui {
20 enum class DomCode;
21 class InputDeviceFactoryEvdev;
22 struct InputDeviceSettingsEvdev;
24 typedef base::Callback<void(scoped_ptr<std::string>)> GetTouchDeviceStatusReply;
25 typedef base::Callback<void(scoped_ptr<std::vector<base::FilePath>>)>
26 GetTouchEventLogReply;
28 // Thread safe proxy for InputDeviceFactoryEvdev.
30 // This is used on the UI thread to proxy calls to the real object on
31 // the device I/O thread.
32 class EVENTS_OZONE_EVDEV_EXPORT InputDeviceFactoryEvdevProxy {
33 public:
34 InputDeviceFactoryEvdevProxy(
35 scoped_refptr<base::SingleThreadTaskRunner> task_runner,
36 base::WeakPtr<InputDeviceFactoryEvdev> input_device_factory);
37 ~InputDeviceFactoryEvdevProxy();
39 // See InputDeviceFactoryEvdev for docs. These calls simply forward to
40 // that object on another thread.
41 void AddInputDevice(int id, const base::FilePath& path);
42 void RemoveInputDevice(const base::FilePath& path);
43 void DisableInternalTouchpad();
44 void EnableInternalTouchpad();
45 void DisableInternalKeyboardExceptKeys(
46 scoped_ptr<std::set<DomCode>> excepted_keys);
47 void EnableInternalKeyboard();
48 void SetCapsLockLed(bool enabled);
49 void UpdateInputDeviceSettings(const InputDeviceSettingsEvdev& settings);
50 void GetTouchDeviceStatus(const GetTouchDeviceStatusReply& reply);
51 void GetTouchEventLog(const base::FilePath& out_dir,
52 const GetTouchEventLogReply& reply);
54 private:
55 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
56 base::WeakPtr<InputDeviceFactoryEvdev> input_device_factory_;
58 DISALLOW_COPY_AND_ASSIGN(InputDeviceFactoryEvdevProxy);
61 } // namespace ui
63 #endif // UI_EVENTS_OZONE_EVDEV_INPUT_DEVICE_FACTORY_PROXY_EVDEV_H_