OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_CHROMEOS_SYSTEM_INPUT_DEVICE_SETTINGS_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_SYSTEM_INPUT_DEVICE_SETTINGS_H_ |
6 #define CHROME_BROWSER_CHROMEOS_SYSTEM_INPUT_DEVICE_SETTINGS_H_ | 6 #define CHROME_BROWSER_CHROMEOS_SYSTEM_INPUT_DEVICE_SETTINGS_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "chromeos/chromeos_export.h" | 10 #include "chromeos/chromeos_export.h" |
11 | 11 |
| 12 class PrefRegistrySimple; |
| 13 |
12 namespace chromeos { | 14 namespace chromeos { |
13 namespace system { | 15 namespace system { |
14 | 16 |
15 class InputDeviceSettings; | 17 class InputDeviceSettings; |
16 | 18 |
17 namespace internal { | 19 namespace internal { |
18 | 20 |
19 // Objects of this class are intended to store values of type T, but might have | 21 // Objects of this class are intended to store values of type T, but might have |
20 // "unset" state. Object will be in "unset" state until Set is called first | 22 // "unset" state. Object will be in "unset" state until Set is called first |
21 // time. | 23 // time. |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 | 160 |
159 // Replaces current instance with |test_settings|. Takes ownership of | 161 // Replaces current instance with |test_settings|. Takes ownership of |
160 // |test_settings|. Default implementation could be returned back by passing | 162 // |test_settings|. Default implementation could be returned back by passing |
161 // NULL to this method. | 163 // NULL to this method. |
162 static void SetSettingsForTesting(InputDeviceSettings* test_settings); | 164 static void SetSettingsForTesting(InputDeviceSettings* test_settings); |
163 | 165 |
164 // Returns true if UI should implement enhanced keyboard support for cases | 166 // Returns true if UI should implement enhanced keyboard support for cases |
165 // where other input devices like mouse are absent. | 167 // where other input devices like mouse are absent. |
166 static bool ForceKeyboardDrivenUINavigation(); | 168 static bool ForceKeyboardDrivenUINavigation(); |
167 | 169 |
| 170 // Registers local pref names for touchpad and touch screen statuses. |
| 171 static void RegisterPrefs(PrefRegistrySimple* registry); |
| 172 |
| 173 void InitTouchDevicesStatusFromLocalPrefs(); |
| 174 |
| 175 // Toggles the status of Touchscreen/Touchpad on or off and updates the local |
| 176 // prefs. |
| 177 void ToggleTouchscreen(); |
| 178 void ToggleTouchpad(); |
| 179 |
168 // Calls |callback| asynchronously after determining if a touchpad is | 180 // Calls |callback| asynchronously after determining if a touchpad is |
169 // connected. | 181 // connected. |
170 virtual void TouchpadExists(const DeviceExistsCallback& callback) = 0; | 182 virtual void TouchpadExists(const DeviceExistsCallback& callback) = 0; |
171 | 183 |
172 // Updates several touchpad settings at a time. Updates only settings that | 184 // Updates several touchpad settings at a time. Updates only settings that |
173 // are set in |settings| object. It is more efficient to use this method to | 185 // are set in |settings| object. It is more efficient to use this method to |
174 // update several settings then calling Set* methods one by one. | 186 // update several settings then calling Set* methods one by one. |
175 virtual void UpdateTouchpadSettings(const TouchpadSettings& settings) = 0; | 187 virtual void UpdateTouchpadSettings(const TouchpadSettings& settings) = 0; |
176 | 188 |
177 // Sets the touchpad sensitivity in the range [kMinPointerSensitivity, | 189 // Sets the touchpad sensitivity in the range [kMinPointerSensitivity, |
(...skipping 25 matching lines...) Expand all Loading... |
203 virtual void SetMouseSensitivity(int value) = 0; | 215 virtual void SetMouseSensitivity(int value) = 0; |
204 | 216 |
205 // Sets the primary mouse button to the right button if |right| is true. | 217 // Sets the primary mouse button to the right button if |right| is true. |
206 virtual void SetPrimaryButtonRight(bool right) = 0; | 218 virtual void SetPrimaryButtonRight(bool right) = 0; |
207 | 219 |
208 // Reapplies previously set touchpad settings. | 220 // Reapplies previously set touchpad settings. |
209 virtual void ReapplyTouchpadSettings() = 0; | 221 virtual void ReapplyTouchpadSettings() = 0; |
210 | 222 |
211 // Reapplies previously set mouse settings. | 223 // Reapplies previously set mouse settings. |
212 virtual void ReapplyMouseSettings() = 0; | 224 virtual void ReapplyMouseSettings() = 0; |
| 225 |
| 226 private: |
| 227 virtual void SetInternalTouchpadEnabled(bool enabled) {} |
| 228 virtual void SetTouchscreensEnabled(bool enabled) {} |
213 }; | 229 }; |
214 | 230 |
215 } // namespace system | 231 } // namespace system |
216 } // namespace chromeos | 232 } // namespace chromeos |
217 | 233 |
218 #endif // CHROME_BROWSER_CHROMEOS_SYSTEM_INPUT_DEVICE_SETTINGS_H_ | 234 #endif // CHROME_BROWSER_CHROMEOS_SYSTEM_INPUT_DEVICE_SETTINGS_H_ |
OLD | NEW |