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 #include "ui/ozone/public/input_controller.h"
7 #include "base/compiler_specific.h"
8 #include "base/logging.h"
14 class StubInputController
: public InputController
{
16 StubInputController();
17 ~StubInputController() override
;
20 bool HasMouse() override
;
21 bool HasTouchpad() override
;
22 bool IsCapsLockEnabled() override
;
23 void SetCapsLockEnabled(bool enabled
) override
;
24 void SetNumLockEnabled(bool enabled
) override
;
25 bool IsAutoRepeatEnabled() override
;
26 void SetAutoRepeatEnabled(bool enabled
) override
;
27 void SetAutoRepeatRate(const base::TimeDelta
& delay
,
28 const base::TimeDelta
& interval
) override
;
29 void GetAutoRepeatRate(base::TimeDelta
* delay
,
30 base::TimeDelta
* interval
) override
;
31 void SetTouchpadSensitivity(int value
) override
;
32 void SetTapToClick(bool enabled
) override
;
33 void SetThreeFingerClick(bool enabled
) override
;
34 void SetTapDragging(bool enabled
) override
;
35 void SetNaturalScroll(bool enabled
) override
;
36 void SetMouseSensitivity(int value
) override
;
37 void SetPrimaryButtonRight(bool right
) override
;
38 void SetTapToClickPaused(bool state
) override
;
39 void GetTouchDeviceStatus(const GetTouchDeviceStatusReply
& reply
) override
;
40 void GetTouchEventLog(const base::FilePath
& out_dir
,
41 const GetTouchEventLogReply
& reply
) override
;
42 void DisableInternalTouchpad() override
;
43 void EnableInternalTouchpad() override
;
44 void DisableInternalKeyboardExceptKeys(
45 scoped_ptr
<std::set
<DomCode
>> excepted_keys
) override
;
46 void EnableInternalKeyboard() override
;
49 DISALLOW_COPY_AND_ASSIGN(StubInputController
);
52 StubInputController::StubInputController() {
55 StubInputController::~StubInputController() {
58 bool StubInputController::HasMouse() {
63 bool StubInputController::HasTouchpad() {
68 bool StubInputController::IsCapsLockEnabled() {
72 void StubInputController::SetCapsLockEnabled(bool enabled
) {
76 void StubInputController::SetNumLockEnabled(bool enabled
) {
80 bool StubInputController::IsAutoRepeatEnabled() {
84 void StubInputController::SetAutoRepeatEnabled(bool enabled
) {
88 void StubInputController::SetAutoRepeatRate(const base::TimeDelta
& delay
,
89 const base::TimeDelta
& interval
) {
93 void StubInputController::GetAutoRepeatRate(base::TimeDelta
* delay
,
94 base::TimeDelta
* interval
) {
98 void StubInputController::SetTouchpadSensitivity(int value
) {
102 void StubInputController::SetTapToClick(bool enabled
) {
106 void StubInputController::SetThreeFingerClick(bool enabled
) {
110 void StubInputController::SetTapDragging(bool enabled
) {
114 void StubInputController::SetNaturalScroll(bool enabled
) {
118 void StubInputController::SetMouseSensitivity(int value
) {
122 void StubInputController::SetPrimaryButtonRight(bool right
) {
126 void StubInputController::SetTapToClickPaused(bool state
) {
130 void StubInputController::GetTouchDeviceStatus(
131 const GetTouchDeviceStatusReply
& reply
) {
132 reply
.Run(scoped_ptr
<std::string
>(new std::string
));
135 void StubInputController::GetTouchEventLog(const base::FilePath
& out_dir
,
136 const GetTouchEventLogReply
& reply
) {
138 scoped_ptr
<std::vector
<base::FilePath
>>(new std::vector
<base::FilePath
>));
141 void StubInputController::DisableInternalTouchpad() {
145 void StubInputController::EnableInternalTouchpad() {
149 void StubInputController::DisableInternalKeyboardExceptKeys(
150 scoped_ptr
<std::set
<DomCode
>> excepted_keys
) {
154 void StubInputController::EnableInternalKeyboard() {
160 scoped_ptr
<InputController
> CreateStubInputController() {
161 return make_scoped_ptr(new StubInputController
);