| 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 |
| 185 // prefs. | 188 // state, otherwise from user prefs. |
| 186 void ToggleTouchscreen(); | 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 between enabled and disabled. |
| 187 void ToggleTouchpad(); | 200 void ToggleTouchpad(); |
| 188 | 201 |
| 189 // Calls |callback|, possibly asynchronously, after determining if a touchpad | 202 // Calls |callback|, possibly asynchronously, after determining if a touchpad |
| 190 // is connected. | 203 // is connected. |
| 191 virtual void TouchpadExists(const DeviceExistsCallback& callback) = 0; | 204 virtual void TouchpadExists(const DeviceExistsCallback& callback) = 0; |
| 192 | 205 |
| 193 // Updates several touchpad settings at a time. Updates only settings that | 206 // 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 | 207 // 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. | 208 // update several settings then calling Set* methods one by one. |
| 196 virtual void UpdateTouchpadSettings(const TouchpadSettings& settings) = 0; | 209 virtual void UpdateTouchpadSettings(const TouchpadSettings& settings) = 0; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 | 251 |
| 239 private: | 252 private: |
| 240 virtual void SetInternalTouchpadEnabled(bool enabled) {} | 253 virtual void SetInternalTouchpadEnabled(bool enabled) {} |
| 241 virtual void SetTouchscreensEnabled(bool enabled) {} | 254 virtual void SetTouchscreensEnabled(bool enabled) {} |
| 242 }; | 255 }; |
| 243 | 256 |
| 244 } // namespace system | 257 } // namespace system |
| 245 } // namespace chromeos | 258 } // namespace chromeos |
| 246 | 259 |
| 247 #endif // CHROME_BROWSER_CHROMEOS_SYSTEM_INPUT_DEVICE_SETTINGS_H_ | 260 #endif // CHROME_BROWSER_CHROMEOS_SYSTEM_INPUT_DEVICE_SETTINGS_H_ |
| OLD | NEW |