| 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 #include "chrome/browser/chromeos/system/fake_input_device_settings.h" | 5 #include "chrome/browser/chromeos/system/fake_input_device_settings.h" |
| 6 | 6 |
| 7 namespace chromeos { | 7 namespace chromeos { |
| 8 namespace system { | 8 namespace system { |
| 9 | 9 |
| 10 FakeInputDeviceSettings::FakeInputDeviceSettings() {} | 10 FakeInputDeviceSettings::FakeInputDeviceSettings() {} |
| 11 | 11 |
| 12 FakeInputDeviceSettings::~FakeInputDeviceSettings() {} | 12 FakeInputDeviceSettings::~FakeInputDeviceSettings() {} |
| 13 | 13 |
| 14 // Overriden from InputDeviceSettings. | 14 // Overriden from InputDeviceSettings. |
| 15 void FakeInputDeviceSettings::TouchpadExists( | 15 void FakeInputDeviceSettings::TouchpadExists( |
| 16 const DeviceExistsCallback& callback) { | 16 const DeviceExistsCallback& callback) { |
| 17 callback.Run(true); | 17 callback.Run(touchpad_exists_); |
| 18 } | 18 } |
| 19 | 19 |
| 20 void FakeInputDeviceSettings::UpdateTouchpadSettings( | 20 void FakeInputDeviceSettings::UpdateTouchpadSettings( |
| 21 const TouchpadSettings& settings) { | 21 const TouchpadSettings& settings) { |
| 22 current_touchpad_settings_.Update(settings); | 22 current_touchpad_settings_.Update(settings); |
| 23 } | 23 } |
| 24 | 24 |
| 25 void FakeInputDeviceSettings::SetTouchpadSensitivity(int value) { | 25 void FakeInputDeviceSettings::SetTouchpadSensitivity(int value) { |
| 26 TouchpadSettings settings; | 26 TouchpadSettings settings; |
| 27 settings.SetSensitivity(value); | 27 settings.SetSensitivity(value); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 47 } | 47 } |
| 48 | 48 |
| 49 void FakeInputDeviceSettings::SetNaturalScroll(bool enabled) { | 49 void FakeInputDeviceSettings::SetNaturalScroll(bool enabled) { |
| 50 TouchpadSettings settings; | 50 TouchpadSettings settings; |
| 51 settings.SetNaturalScroll(enabled); | 51 settings.SetNaturalScroll(enabled); |
| 52 UpdateTouchpadSettings(settings); | 52 UpdateTouchpadSettings(settings); |
| 53 } | 53 } |
| 54 | 54 |
| 55 void FakeInputDeviceSettings::MouseExists( | 55 void FakeInputDeviceSettings::MouseExists( |
| 56 const DeviceExistsCallback& callback) { | 56 const DeviceExistsCallback& callback) { |
| 57 callback.Run(false); | 57 callback.Run(mouse_exists_); |
| 58 } | 58 } |
| 59 | 59 |
| 60 void FakeInputDeviceSettings::UpdateMouseSettings( | 60 void FakeInputDeviceSettings::UpdateMouseSettings( |
| 61 const MouseSettings& settings) { | 61 const MouseSettings& settings) { |
| 62 current_mouse_settings_.Update(settings); | 62 current_mouse_settings_.Update(settings); |
| 63 } | 63 } |
| 64 | 64 |
| 65 void FakeInputDeviceSettings::SetMouseSensitivity(int value) { | 65 void FakeInputDeviceSettings::SetMouseSensitivity(int value) { |
| 66 MouseSettings settings; | 66 MouseSettings settings; |
| 67 settings.SetSensitivity(value); | 67 settings.SetSensitivity(value); |
| 68 UpdateMouseSettings(settings); | 68 UpdateMouseSettings(settings); |
| 69 } | 69 } |
| 70 | 70 |
| 71 void FakeInputDeviceSettings::SetPrimaryButtonRight(bool right) { | 71 void FakeInputDeviceSettings::SetPrimaryButtonRight(bool right) { |
| 72 MouseSettings settings; | 72 MouseSettings settings; |
| 73 settings.SetPrimaryButtonRight(right); | 73 settings.SetPrimaryButtonRight(right); |
| 74 UpdateMouseSettings(settings); | 74 UpdateMouseSettings(settings); |
| 75 } | 75 } |
| 76 | 76 |
| 77 void FakeInputDeviceSettings::ReapplyTouchpadSettings() { | 77 void FakeInputDeviceSettings::ReapplyTouchpadSettings() { |
| 78 } | 78 } |
| 79 | 79 |
| 80 void FakeInputDeviceSettings::ReapplyMouseSettings() { | 80 void FakeInputDeviceSettings::ReapplyMouseSettings() { |
| 81 } | 81 } |
| 82 | 82 |
| 83 InputDeviceSettings::FakeInterface* |
| 84 FakeInputDeviceSettings::GetFakeInterface() { |
| 85 return this; |
| 86 } |
| 87 |
| 88 void FakeInputDeviceSettings::set_touchpad_exists(bool exists) { |
| 89 touchpad_exists_ = exists; |
| 90 } |
| 91 |
| 92 void FakeInputDeviceSettings::set_mouse_exists(bool exists) { |
| 93 mouse_exists_ = exists; |
| 94 } |
| 95 |
| 96 const TouchpadSettings& FakeInputDeviceSettings::current_touchpad_settings() |
| 97 const { |
| 98 return current_touchpad_settings_; |
| 99 } |
| 100 |
| 101 const MouseSettings& FakeInputDeviceSettings::current_mouse_settings() const { |
| 102 return current_mouse_settings_; |
| 103 } |
| 104 |
| 83 } // namespace system | 105 } // namespace system |
| 84 } // namespace chromeos | 106 } // namespace chromeos |
| OLD | NEW |