Chromium Code Reviews| 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" |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 167 | 167 |
| 168 virtual ~InputDeviceSettings() {} | 168 virtual ~InputDeviceSettings() {} |
| 169 | 169 |
| 170 // Returns current instance of InputDeviceSettings. | 170 // Returns current instance of InputDeviceSettings. |
| 171 static InputDeviceSettings* Get(); | 171 static InputDeviceSettings* Get(); |
| 172 | 172 |
| 173 // Returns true if UI should implement enhanced keyboard support for cases | 173 // Returns true if UI should implement enhanced keyboard support for cases |
| 174 // where other input devices like mouse are absent. | 174 // where other input devices like mouse are absent. |
| 175 static bool ForceKeyboardDrivenUINavigation(); | 175 static bool ForceKeyboardDrivenUINavigation(); |
| 176 | 176 |
| 177 // Registers profile pref names for touchpad and touch screen statuses. | 177 // Registers local state pref names for touchscreen status. |
| 178 static void RegisterPrefs(PrefRegistrySimple* registry); | |
| 179 | |
| 180 // Registers profile pref names for touchpad and touchscreen statuses. | |
| 178 static void RegisterProfilePrefs(PrefRegistrySimple* registry); | 181 static void RegisterProfilePrefs(PrefRegistrySimple* registry); |
| 179 | 182 |
| 180 // Updates the on/off status of the touchscreen/touchpad from the active | 183 // Updates the enabled/disabled status of the touchscreen/touchpad from the |
| 181 // user's preferences. | 184 // preferences. |
| 182 void UpdateTouchDevicesStatusFromActiveProfilePrefs(); | 185 void UpdateTouchDevicesStatusFromPrefs(); |
| 183 | 186 |
| 184 // Toggles the status of Touchscreen/Touchpad on or off and updates the local | 187 // If |use_local_state| is true, returns the touchscreen status from local |
| 188 // state, otherwise from user prefs. | |
| 189 bool IsTouchscreenEnabledInPrefs(bool use_local_state) const; | |
| 190 | |
| 191 // Sets the status of touchscreen to |enabled| in prefs. If |use_local_state|, | |
| 192 // pref is set in local state, otherwise in user pref. | |
| 193 void SetTouchscreenEnabledInPrefs(bool enabled, bool use_local_state); | |
| 194 | |
| 195 // Updates the enabled/disabled status of the touchscreen from prefs. Enabled | |
| 196 // if both local state and user prefs are enabled, otherwise disabled. | |
| 197 void UpdateTouchscreenStatusFromPrefs(); | |
| 198 | |
| 199 // Toggles the status of touchpad enabled or disabled and updates the user | |
|
Daniel Erat
2016/12/03 03:11:55
nit: "... between enabled and disabled"
| |
| 185 // prefs. | 200 // prefs. |
| 186 void ToggleTouchscreen(); | |
| 187 void ToggleTouchpad(); | 201 void ToggleTouchpad(); |
| 188 | 202 |
| 189 // Calls |callback|, possibly asynchronously, after determining if a touchpad | 203 // Calls |callback|, possibly asynchronously, after determining if a touchpad |
| 190 // is connected. | 204 // is connected. |
| 191 virtual void TouchpadExists(const DeviceExistsCallback& callback) = 0; | 205 virtual void TouchpadExists(const DeviceExistsCallback& callback) = 0; |
| 192 | 206 |
| 193 // Updates several touchpad settings at a time. Updates only settings that | 207 // Updates several touchpad settings at a time. Updates only settings that |
| 194 // are set in |settings| object. It is more efficient to use this method to | 208 // are set in |settings| object. It is more efficient to use this method to |
| 195 // update several settings then calling Set* methods one by one. | 209 // update several settings then calling Set* methods one by one. |
| 196 virtual void UpdateTouchpadSettings(const TouchpadSettings& settings) = 0; | 210 virtual void UpdateTouchpadSettings(const TouchpadSettings& settings) = 0; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 238 | 252 |
| 239 private: | 253 private: |
| 240 virtual void SetInternalTouchpadEnabled(bool enabled) {} | 254 virtual void SetInternalTouchpadEnabled(bool enabled) {} |
| 241 virtual void SetTouchscreensEnabled(bool enabled) {} | 255 virtual void SetTouchscreensEnabled(bool enabled) {} |
| 242 }; | 256 }; |
| 243 | 257 |
| 244 } // namespace system | 258 } // namespace system |
| 245 } // namespace chromeos | 259 } // namespace chromeos |
| 246 | 260 |
| 247 #endif // CHROME_BROWSER_CHROMEOS_SYSTEM_INPUT_DEVICE_SETTINGS_H_ | 261 #endif // CHROME_BROWSER_CHROMEOS_SYSTEM_INPUT_DEVICE_SETTINGS_H_ |
| OLD | NEW |