OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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. |
| 4 |
| 5 #include "ui/events/ozone/evdev/input_device_factory_proxy_evdev.h" |
| 6 |
| 7 #include "base/bind.h" |
| 8 #include "ui/events/ozone/evdev/input_device_factory_evdev.h" |
| 9 |
| 10 namespace ui { |
| 11 |
| 12 InputDeviceFactoryProxyEvdev::InputDeviceFactoryProxyEvdev( |
| 13 scoped_refptr<base::SingleThreadTaskRunner> task_runner, |
| 14 base::WeakPtr<InputDeviceFactoryEvdev> input_device_factory) |
| 15 : task_runner_(task_runner), input_device_factory_(input_device_factory) { |
| 16 } |
| 17 |
| 18 InputDeviceFactoryProxyEvdev::~InputDeviceFactoryProxyEvdev() { |
| 19 } |
| 20 |
| 21 void InputDeviceFactoryProxyEvdev::AddInputDevice(int id, |
| 22 const base::FilePath& path) { |
| 23 task_runner_->PostTask(FROM_HERE, |
| 24 base::Bind(&InputDeviceFactoryEvdev::AddInputDevice, |
| 25 input_device_factory_, id, path)); |
| 26 } |
| 27 |
| 28 void InputDeviceFactoryProxyEvdev::RemoveInputDevice( |
| 29 const base::FilePath& path) { |
| 30 task_runner_->PostTask(FROM_HERE, |
| 31 base::Bind(&InputDeviceFactoryEvdev::RemoveInputDevice, |
| 32 input_device_factory_, path)); |
| 33 } |
| 34 |
| 35 void InputDeviceFactoryProxyEvdev::DisableInternalTouchpad() { |
| 36 task_runner_->PostTask( |
| 37 FROM_HERE, base::Bind(&InputDeviceFactoryEvdev::DisableInternalTouchpad, |
| 38 input_device_factory_)); |
| 39 } |
| 40 |
| 41 void InputDeviceFactoryProxyEvdev::EnableInternalTouchpad() { |
| 42 task_runner_->PostTask( |
| 43 FROM_HERE, base::Bind(&InputDeviceFactoryEvdev::EnableInternalTouchpad, |
| 44 input_device_factory_)); |
| 45 } |
| 46 |
| 47 void InputDeviceFactoryProxyEvdev::DisableInternalKeyboardExceptKeys( |
| 48 scoped_ptr<std::set<DomCode>> excepted_keys) { |
| 49 task_runner_->PostTask( |
| 50 FROM_HERE, |
| 51 base::Bind(&InputDeviceFactoryEvdev::DisableInternalKeyboardExceptKeys, |
| 52 input_device_factory_, base::Passed(&excepted_keys))); |
| 53 } |
| 54 |
| 55 void InputDeviceFactoryProxyEvdev::EnableInternalKeyboard() { |
| 56 task_runner_->PostTask( |
| 57 FROM_HERE, base::Bind(&InputDeviceFactoryEvdev::EnableInternalKeyboard, |
| 58 input_device_factory_)); |
| 59 } |
| 60 |
| 61 void InputDeviceFactoryProxyEvdev::SetTouchpadSensitivity(int value) { |
| 62 task_runner_->PostTask( |
| 63 FROM_HERE, base::Bind(&InputDeviceFactoryEvdev::SetTouchpadSensitivity, |
| 64 input_device_factory_, value)); |
| 65 } |
| 66 |
| 67 void InputDeviceFactoryProxyEvdev::SetTapToClick(bool enabled) { |
| 68 task_runner_->PostTask(FROM_HERE, |
| 69 base::Bind(&InputDeviceFactoryEvdev::SetTapToClick, |
| 70 input_device_factory_, enabled)); |
| 71 } |
| 72 |
| 73 void InputDeviceFactoryProxyEvdev::SetThreeFingerClick(bool enabled) { |
| 74 task_runner_->PostTask( |
| 75 FROM_HERE, base::Bind(&InputDeviceFactoryEvdev::SetThreeFingerClick, |
| 76 input_device_factory_, enabled)); |
| 77 } |
| 78 |
| 79 void InputDeviceFactoryProxyEvdev::SetTapDragging(bool enabled) { |
| 80 task_runner_->PostTask(FROM_HERE, |
| 81 base::Bind(&InputDeviceFactoryEvdev::SetTapDragging, |
| 82 input_device_factory_, enabled)); |
| 83 } |
| 84 |
| 85 void InputDeviceFactoryProxyEvdev::SetNaturalScroll(bool enabled) { |
| 86 task_runner_->PostTask(FROM_HERE, |
| 87 base::Bind(&InputDeviceFactoryEvdev::SetNaturalScroll, |
| 88 input_device_factory_, enabled)); |
| 89 } |
| 90 |
| 91 void InputDeviceFactoryProxyEvdev::SetMouseSensitivity(int value) { |
| 92 task_runner_->PostTask( |
| 93 FROM_HERE, base::Bind(&InputDeviceFactoryEvdev::SetMouseSensitivity, |
| 94 input_device_factory_, value)); |
| 95 } |
| 96 |
| 97 void InputDeviceFactoryProxyEvdev::SetTapToClickPaused(bool state) { |
| 98 task_runner_->PostTask( |
| 99 FROM_HERE, base::Bind(&InputDeviceFactoryEvdev::SetTapToClickPaused, |
| 100 input_device_factory_, state)); |
| 101 } |
| 102 |
| 103 } // namespace ui |
OLD | NEW |