| 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 virtual ~InputDeviceSettings() {} | 158 virtual ~InputDeviceSettings() {} |
| 159 | 159 |
| 160 // Returns current instance of InputDeviceSettings. | 160 // Returns current instance of InputDeviceSettings. |
| 161 static InputDeviceSettings* Get(); | 161 static InputDeviceSettings* Get(); |
| 162 | 162 |
| 163 // Replaces current instance with |test_settings|. Takes ownership of | 163 // Replaces current instance with |test_settings|. Takes ownership of |
| 164 // |test_settings|. Default implementation could be returned back by passing | 164 // |test_settings|. Default implementation could be returned back by passing |
| 165 // NULL to this method. | 165 // NULL to this method. |
| 166 static void SetSettingsForTesting(InputDeviceSettings* test_settings); | 166 static void SetSettingsForTesting(InputDeviceSettings* test_settings); |
| 167 | 167 |
| 168 // Returns true if the current instance was passed to SetSettingsForTesting. |
| 169 static bool DidSetSettingsForTesting(); |
| 170 |
| 168 // Returns true if UI should implement enhanced keyboard support for cases | 171 // Returns true if UI should implement enhanced keyboard support for cases |
| 169 // where other input devices like mouse are absent. | 172 // where other input devices like mouse are absent. |
| 170 static bool ForceKeyboardDrivenUINavigation(); | 173 static bool ForceKeyboardDrivenUINavigation(); |
| 171 | 174 |
| 172 // Registers local pref names for touchpad and touch screen statuses. | 175 // Registers local pref names for touchpad and touch screen statuses. |
| 173 static void RegisterPrefs(PrefRegistrySimple* registry); | 176 static void RegisterPrefs(PrefRegistrySimple* registry); |
| 174 | 177 |
| 175 void InitTouchDevicesStatusFromLocalPrefs(); | 178 void InitTouchDevicesStatusFromLocalPrefs(); |
| 176 | 179 |
| 177 // Toggles the status of Touchscreen/Touchpad on or off and updates the local | 180 // Toggles the status of Touchscreen/Touchpad on or off and updates the local |
| 178 // prefs. | 181 // prefs. |
| 179 void ToggleTouchscreen(); | 182 void ToggleTouchscreen(); |
| 180 void ToggleTouchpad(); | 183 void ToggleTouchpad(); |
| 181 | 184 |
| 182 // Calls |callback| asynchronously after determining if a touchpad is | 185 // Calls |callback|, possibly asynchronously, after determining if a touchpad |
| 183 // connected. | 186 // is connected. |
| 184 virtual void TouchpadExists(const DeviceExistsCallback& callback) = 0; | 187 virtual void TouchpadExists(const DeviceExistsCallback& callback) = 0; |
| 185 | 188 |
| 186 // Updates several touchpad settings at a time. Updates only settings that | 189 // Updates several touchpad settings at a time. Updates only settings that |
| 187 // are set in |settings| object. It is more efficient to use this method to | 190 // are set in |settings| object. It is more efficient to use this method to |
| 188 // update several settings then calling Set* methods one by one. | 191 // update several settings then calling Set* methods one by one. |
| 189 virtual void UpdateTouchpadSettings(const TouchpadSettings& settings) = 0; | 192 virtual void UpdateTouchpadSettings(const TouchpadSettings& settings) = 0; |
| 190 | 193 |
| 191 // Sets the touchpad sensitivity in the range [kMinPointerSensitivity, | 194 // Sets the touchpad sensitivity in the range [kMinPointerSensitivity, |
| 192 // kMaxPointerSensitivity]. | 195 // kMaxPointerSensitivity]. |
| 193 virtual void SetTouchpadSensitivity(int value) = 0; | 196 virtual void SetTouchpadSensitivity(int value) = 0; |
| 194 | 197 |
| 195 // Turns tap to click on/off. | 198 // Turns tap to click on/off. |
| 196 virtual void SetTapToClick(bool enabled) = 0; | 199 virtual void SetTapToClick(bool enabled) = 0; |
| 197 | 200 |
| 198 // Switch for three-finger click. | 201 // Switch for three-finger click. |
| 199 virtual void SetThreeFingerClick(bool enabled) = 0; | 202 virtual void SetThreeFingerClick(bool enabled) = 0; |
| 200 | 203 |
| 201 // Turns tap-dragging on/off. | 204 // Turns tap-dragging on/off. |
| 202 virtual void SetTapDragging(bool enabled) = 0; | 205 virtual void SetTapDragging(bool enabled) = 0; |
| 203 | 206 |
| 204 // Turns natural scrolling on/off for all devices except wheel mice | 207 // Turns natural scrolling on/off for all devices except wheel mice |
| 205 virtual void SetNaturalScroll(bool enabled) = 0; | 208 virtual void SetNaturalScroll(bool enabled) = 0; |
| 206 | 209 |
| 207 // Calls |callback| asynchronously after determining if a mouse is connected. | 210 // Calls |callback|, possibly asynchronously, after determining if a mouse is |
| 211 // connected. |
| 208 virtual void MouseExists(const DeviceExistsCallback& callback) = 0; | 212 virtual void MouseExists(const DeviceExistsCallback& callback) = 0; |
| 209 | 213 |
| 210 // Updates several mouse settings at a time. Updates only settings that | 214 // Updates several mouse settings at a time. Updates only settings that |
| 211 // are set in |settings| object. It is more efficient to use this method to | 215 // are set in |settings| object. It is more efficient to use this method to |
| 212 // update several settings then calling Set* methods one by one. | 216 // update several settings then calling Set* methods one by one. |
| 213 virtual void UpdateMouseSettings(const MouseSettings& settings) = 0; | 217 virtual void UpdateMouseSettings(const MouseSettings& settings) = 0; |
| 214 | 218 |
| 215 // Sets the mouse sensitivity in the range [kMinPointerSensitivity, | 219 // Sets the mouse sensitivity in the range [kMinPointerSensitivity, |
| 216 // kMaxPointerSensitivity]. | 220 // kMaxPointerSensitivity]. |
| 217 virtual void SetMouseSensitivity(int value) = 0; | 221 virtual void SetMouseSensitivity(int value) = 0; |
| 218 | 222 |
| 219 // Sets the primary mouse button to the right button if |right| is true. | 223 // Sets the primary mouse button to the right button if |right| is true. |
| 220 virtual void SetPrimaryButtonRight(bool right) = 0; | 224 virtual void SetPrimaryButtonRight(bool right) = 0; |
| 221 | 225 |
| 222 // Reapplies previously set touchpad settings. | 226 // Reapplies previously set touchpad settings. |
| 223 virtual void ReapplyTouchpadSettings() = 0; | 227 virtual void ReapplyTouchpadSettings() = 0; |
| 224 | 228 |
| 225 // Reapplies previously set mouse settings. | 229 // Reapplies previously set mouse settings. |
| 226 virtual void ReapplyMouseSettings() = 0; | 230 virtual void ReapplyMouseSettings() = 0; |
| 227 | 231 |
| 228 private: | 232 private: |
| 229 virtual void SetInternalTouchpadEnabled(bool enabled) {} | 233 virtual void SetInternalTouchpadEnabled(bool enabled) {} |
| 230 virtual void SetTouchscreensEnabled(bool enabled) {} | 234 virtual void SetTouchscreensEnabled(bool enabled) {} |
| 231 }; | 235 }; |
| 232 | 236 |
| 233 } // namespace system | 237 } // namespace system |
| 234 } // namespace chromeos | 238 } // namespace chromeos |
| 235 | 239 |
| 236 #endif // CHROME_BROWSER_CHROMEOS_SYSTEM_INPUT_DEVICE_SETTINGS_H_ | 240 #endif // CHROME_BROWSER_CHROMEOS_SYSTEM_INPUT_DEVICE_SETTINGS_H_ |
| OLD | NEW |