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/input_device_settings.h" | 5 #include "chrome/browser/chromeos/system/input_device_settings.h" |
6 | 6 |
7 #include "content/public/browser/browser_thread.h" | 7 #include "content/public/browser/browser_thread.h" |
8 #include "ui/ozone/public/input_controller.h" | 8 #include "ui/ozone/public/input_controller.h" |
9 #include "ui/ozone/public/ozone_platform.h" | 9 #include "ui/ozone/public/ozone_platform.h" |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 void SetTapToClick(bool enabled) override; | 32 void SetTapToClick(bool enabled) override; |
33 void SetThreeFingerClick(bool enabled) override; | 33 void SetThreeFingerClick(bool enabled) override; |
34 void SetTapDragging(bool enabled) override; | 34 void SetTapDragging(bool enabled) override; |
35 void SetNaturalScroll(bool enabled) override; | 35 void SetNaturalScroll(bool enabled) override; |
36 void MouseExists(const DeviceExistsCallback& callback) override; | 36 void MouseExists(const DeviceExistsCallback& callback) override; |
37 void UpdateMouseSettings(const MouseSettings& settings) override; | 37 void UpdateMouseSettings(const MouseSettings& settings) override; |
38 void SetMouseSensitivity(int value) override; | 38 void SetMouseSensitivity(int value) override; |
39 void SetPrimaryButtonRight(bool right) override; | 39 void SetPrimaryButtonRight(bool right) override; |
40 void ReapplyTouchpadSettings() override; | 40 void ReapplyTouchpadSettings() override; |
41 void ReapplyMouseSettings() override; | 41 void ReapplyMouseSettings() override; |
| 42 void SetInternalTouchpadEnabled(bool enabled) override; |
42 | 43 |
43 // Cached InputController pointer. It should be fixed throughout the browser | 44 // Cached InputController pointer. It should be fixed throughout the browser |
44 // session. | 45 // session. |
45 ui::InputController* input_controller_; | 46 ui::InputController* input_controller_; |
46 | 47 |
47 // Respective device setting objects. | 48 // Respective device setting objects. |
48 TouchpadSettings current_touchpad_settings_; | 49 TouchpadSettings current_touchpad_settings_; |
49 MouseSettings current_mouse_settings_; | 50 MouseSettings current_mouse_settings_; |
50 | 51 |
51 DISALLOW_COPY_AND_ASSIGN(InputDeviceSettingsImplOzone); | 52 DISALLOW_COPY_AND_ASSIGN(InputDeviceSettingsImplOzone); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 } | 122 } |
122 | 123 |
123 void InputDeviceSettingsImplOzone::ReapplyTouchpadSettings() { | 124 void InputDeviceSettingsImplOzone::ReapplyTouchpadSettings() { |
124 TouchpadSettings::Apply(current_touchpad_settings_, this); | 125 TouchpadSettings::Apply(current_touchpad_settings_, this); |
125 } | 126 } |
126 | 127 |
127 void InputDeviceSettingsImplOzone::ReapplyMouseSettings() { | 128 void InputDeviceSettingsImplOzone::ReapplyMouseSettings() { |
128 MouseSettings::Apply(current_mouse_settings_, this); | 129 MouseSettings::Apply(current_mouse_settings_, this); |
129 } | 130 } |
130 | 131 |
| 132 void InputDeviceSettingsImplOzone::SetInternalTouchpadEnabled(bool enabled) { |
| 133 input_controller_->SetInternalTouchpadEnabled(enabled); |
| 134 } |
| 135 |
131 } // namespace | 136 } // namespace |
132 | 137 |
133 // static | 138 // static |
134 InputDeviceSettings* InputDeviceSettings::Get() { | 139 InputDeviceSettings* InputDeviceSettings::Get() { |
135 if (g_test_instance) | 140 if (g_test_instance) |
136 return g_test_instance; | 141 return g_test_instance; |
137 if (!g_instance) | 142 if (!g_instance) |
138 g_instance = new InputDeviceSettingsImplOzone; | 143 g_instance = new InputDeviceSettingsImplOzone; |
139 return g_instance; | 144 return g_instance; |
140 } | 145 } |
141 | 146 |
142 // static | 147 // static |
143 void InputDeviceSettings::SetSettingsForTesting( | 148 void InputDeviceSettings::SetSettingsForTesting( |
144 InputDeviceSettings* test_settings) { | 149 InputDeviceSettings* test_settings) { |
145 if (g_test_instance == test_settings) | 150 if (g_test_instance == test_settings) |
146 return; | 151 return; |
147 delete g_test_instance; | 152 delete g_test_instance; |
148 g_test_instance = test_settings; | 153 g_test_instance = test_settings; |
149 } | 154 } |
150 | 155 |
151 } // namespace system | 156 } // namespace system |
152 } // namespace chromeos | 157 } // namespace chromeos |
OLD | NEW |