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_
10 #include "base/compiler_specific.h"
11 #include "base/files/file_path.h"
12 #include "base/memory/ref_counted.h"
13 #include "base/memory/weak_ptr.h"
14 #include "base/single_thread_task_runner.h"
15 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h"
20 class InputDeviceFactoryEvdev
;
22 typedef base::Callback
<void(scoped_ptr
<std::string
>)> GetTouchDeviceStatusReply
;
24 // Thread safe proxy for InputDeviceFactoryEvdev.
26 // This is used on the UI thread to proxy calls to the real object on
27 // the device I/O thread.
28 class EVENTS_OZONE_EVDEV_EXPORT InputDeviceFactoryEvdevProxy
{
30 InputDeviceFactoryEvdevProxy(
31 scoped_refptr
<base::SingleThreadTaskRunner
> task_runner
,
32 base::WeakPtr
<InputDeviceFactoryEvdev
> input_device_factory
);
33 ~InputDeviceFactoryEvdevProxy();
35 // See InputDeviceFactoryEvdev for docs. These calls simply forward to
36 // that object on another thread.
37 void AddInputDevice(int id
, const base::FilePath
& path
);
38 void RemoveInputDevice(const base::FilePath
& path
);
39 void DisableInternalTouchpad();
40 void EnableInternalTouchpad();
41 void DisableInternalKeyboardExceptKeys(
42 scoped_ptr
<std::set
<DomCode
>> excepted_keys
);
43 void EnableInternalKeyboard();
44 void SetTouchpadSensitivity(int value
);
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
);
54 scoped_refptr
<base::SingleThreadTaskRunner
> task_runner_
;
55 base::WeakPtr
<InputDeviceFactoryEvdev
> input_device_factory_
;
57 DISALLOW_COPY_AND_ASSIGN(InputDeviceFactoryEvdevProxy
);
62 #endif // UI_EVENTS_OZONE_EVDEV_INPUT_DEVICE_FACTORY_PROXY_EVDEV_H_