| Index: chrome/browser/chromeos/system/input_device_settings.cc
|
| diff --git a/chrome/browser/chromeos/system/input_device_settings.cc b/chrome/browser/chromeos/system/input_device_settings.cc
|
| index eb941053623c398f05500578868c35f5f357ae43..fcd3557b234eb05aea436456cd131a05b68d556e 100644
|
| --- a/chrome/browser/chromeos/system/input_device_settings.cc
|
| +++ b/chrome/browser/chromeos/system/input_device_settings.cc
|
| @@ -244,10 +244,7 @@ void InputDeviceSettings::UpdateTouchDevicesStatusFromActiveProfilePrefs() {
|
| if (!user_prefs)
|
| return;
|
|
|
| - const bool touch_screen_status =
|
| - user_prefs->HasPrefPath(::prefs::kTouchScreenEnabled)
|
| - ? user_prefs->GetBoolean(::prefs::kTouchScreenEnabled)
|
| - : true;
|
| + const bool touch_screen_status = IsTouchscreenEnabled();
|
|
|
| const bool touch_pad_status =
|
| user_prefs->HasPrefPath(::prefs::kTouchPadEnabled)
|
| @@ -263,15 +260,22 @@ void InputDeviceSettings::ToggleTouchscreen() {
|
| if (!user_prefs)
|
| return;
|
|
|
| - const bool touch_screen_status =
|
| - user_prefs->HasPrefPath(::prefs::kTouchScreenEnabled)
|
| - ? user_prefs->GetBoolean(::prefs::kTouchScreenEnabled)
|
| - : true;
|
| + const bool touch_screen_status = IsTouchscreenEnabled();
|
|
|
| user_prefs->SetBoolean(::prefs::kTouchScreenEnabled, !touch_screen_status);
|
| SetTouchscreensEnabled(!touch_screen_status);
|
| }
|
|
|
| +bool InputDeviceSettings::IsTouchscreenEnabled() const {
|
| + PrefService* user_prefs = GetActiveProfilePrefs();
|
| + if (!user_prefs)
|
| + return true;
|
| +
|
| + return user_prefs->HasPrefPath(::prefs::kTouchScreenEnabled)
|
| + ? user_prefs->GetBoolean(::prefs::kTouchScreenEnabled)
|
| + : true;
|
| +}
|
| +
|
| void InputDeviceSettings::ToggleTouchpad() {
|
| PrefService* user_prefs = GetActiveProfilePrefs();
|
| if (!user_prefs)
|
|
|