Chromium Code Reviews| 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 : mouse_exists_(true), touchpad_exists_(true) {} | |
|
stevenjb
2016/06/30 00:17:30
nit: initialize in header
michaelpg
2016/07/01 22:01:48
Done.
| |
| 11 | 12 |
| 12 FakeInputDeviceSettings::~FakeInputDeviceSettings() {} | 13 FakeInputDeviceSettings::~FakeInputDeviceSettings() {} |
| 13 | 14 |
| 14 // Overriden from InputDeviceSettings. | 15 // Overriden from InputDeviceSettings. |
| 15 void FakeInputDeviceSettings::TouchpadExists( | 16 void FakeInputDeviceSettings::TouchpadExists( |
| 16 const DeviceExistsCallback& callback) { | 17 const DeviceExistsCallback& callback) { |
| 17 callback.Run(true); | 18 callback.Run(touchpad_exists_); |
| 18 } | 19 } |
| 19 | 20 |
| 20 void FakeInputDeviceSettings::UpdateTouchpadSettings( | 21 void FakeInputDeviceSettings::UpdateTouchpadSettings( |
| 21 const TouchpadSettings& settings) { | 22 const TouchpadSettings& settings) { |
| 22 current_touchpad_settings_.Update(settings); | 23 current_touchpad_settings_.Update(settings); |
| 23 } | 24 } |
| 24 | 25 |
| 25 void FakeInputDeviceSettings::SetTouchpadSensitivity(int value) { | 26 void FakeInputDeviceSettings::SetTouchpadSensitivity(int value) { |
| 26 TouchpadSettings settings; | 27 TouchpadSettings settings; |
| 27 settings.SetSensitivity(value); | 28 settings.SetSensitivity(value); |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 47 } | 48 } |
| 48 | 49 |
| 49 void FakeInputDeviceSettings::SetNaturalScroll(bool enabled) { | 50 void FakeInputDeviceSettings::SetNaturalScroll(bool enabled) { |
| 50 TouchpadSettings settings; | 51 TouchpadSettings settings; |
| 51 settings.SetNaturalScroll(enabled); | 52 settings.SetNaturalScroll(enabled); |
| 52 UpdateTouchpadSettings(settings); | 53 UpdateTouchpadSettings(settings); |
| 53 } | 54 } |
| 54 | 55 |
| 55 void FakeInputDeviceSettings::MouseExists( | 56 void FakeInputDeviceSettings::MouseExists( |
| 56 const DeviceExistsCallback& callback) { | 57 const DeviceExistsCallback& callback) { |
| 57 callback.Run(false); | 58 callback.Run(mouse_exists_); |
| 58 } | 59 } |
| 59 | 60 |
| 60 void FakeInputDeviceSettings::UpdateMouseSettings( | 61 void FakeInputDeviceSettings::UpdateMouseSettings( |
| 61 const MouseSettings& settings) { | 62 const MouseSettings& settings) { |
| 62 current_mouse_settings_.Update(settings); | 63 current_mouse_settings_.Update(settings); |
| 63 } | 64 } |
| 64 | 65 |
| 65 void FakeInputDeviceSettings::SetMouseSensitivity(int value) { | 66 void FakeInputDeviceSettings::SetMouseSensitivity(int value) { |
| 66 MouseSettings settings; | 67 MouseSettings settings; |
| 67 settings.SetSensitivity(value); | 68 settings.SetSensitivity(value); |
| 68 UpdateMouseSettings(settings); | 69 UpdateMouseSettings(settings); |
| 69 } | 70 } |
| 70 | 71 |
| 71 void FakeInputDeviceSettings::SetPrimaryButtonRight(bool right) { | 72 void FakeInputDeviceSettings::SetPrimaryButtonRight(bool right) { |
| 72 MouseSettings settings; | 73 MouseSettings settings; |
| 73 settings.SetPrimaryButtonRight(right); | 74 settings.SetPrimaryButtonRight(right); |
| 74 UpdateMouseSettings(settings); | 75 UpdateMouseSettings(settings); |
| 75 } | 76 } |
| 76 | 77 |
| 77 void FakeInputDeviceSettings::ReapplyTouchpadSettings() { | 78 void FakeInputDeviceSettings::ReapplyTouchpadSettings() { |
| 78 } | 79 } |
| 79 | 80 |
| 80 void FakeInputDeviceSettings::ReapplyMouseSettings() { | 81 void FakeInputDeviceSettings::ReapplyMouseSettings() { |
| 81 } | 82 } |
| 82 | 83 |
| 84 void FakeInputDeviceSettings::SetMouseExists(bool exists) { | |
| 85 mouse_exists_ = exists; | |
| 86 } | |
| 87 | |
| 88 void FakeInputDeviceSettings::SetTouchpadExists(bool exists) { | |
| 89 touchpad_exists_ = exists; | |
| 90 } | |
| 91 | |
| 83 } // namespace system | 92 } // namespace system |
| 84 } // namespace chromeos | 93 } // namespace chromeos |
| OLD | NEW |