Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(293)

Side by Side Diff: chrome/browser/chromeos/system/input_device_settings.h

Issue 2533373002: Enabled/disable touch screen in TabletPowerButtonController (Closed)
Patch Set: incorporate comments from gab@ and afakhry@ Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 local pref names for touch screen status.
Daniel Erat 2016/12/02 21:48:57 nit: s/touch screen/touchscreen/
Qiang(Joe) Xu 2016/12/02 23:55:11 Done.
178 static void RegisterPrefs(PrefRegistrySimple* registry);
179
177 // Registers profile pref names for touchpad and touch screen statuses. 180 // Registers profile pref names for touchpad and touch screen 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 on/off status of the touchscreen/touchpad from the preferences.
181 // user's preferences. 184 void UpdateTouchDevicesStatusFromPrefs();
182 void UpdateTouchDevicesStatusFromActiveProfilePrefs();
183 185
184 // Toggles the status of Touchscreen/Touchpad on or off and updates the local 186 // If |is_local| is true, returns the touchscreen status from local prefs,
185 // prefs. 187 // otherwise from user prefs.
186 void ToggleTouchscreen(); 188 bool IsTouchscreenEnabledInPrefs(bool is_local) const;
189
190 // Sets the status of touchscreen to |enabled| in prefs. If |is_local|, pref
191 // is set in local pref, otherwise in user pref.
Daniel Erat 2016/12/02 21:48:57 nit: s/local pref/local state/
Qiang(Joe) Xu 2016/12/02 23:55:11 Done.
192 void SetTouchscreenEnabledInPrefs(bool enabled, bool is_local);
193
194 // Updates the on/off status of the touchscreen from the combination of local
195 // and user's preferences.
196 void UpdateTouchscreenStatusFromPrefs();
197
198 // Toggles the status of touchpad on or off and updates the user prefs.
187 void ToggleTouchpad(); 199 void ToggleTouchpad();
188 200
189 // Calls |callback|, possibly asynchronously, after determining if a touchpad 201 // Calls |callback|, possibly asynchronously, after determining if a touchpad
190 // is connected. 202 // is connected.
191 virtual void TouchpadExists(const DeviceExistsCallback& callback) = 0; 203 virtual void TouchpadExists(const DeviceExistsCallback& callback) = 0;
192 204
193 // Updates several touchpad settings at a time. Updates only settings that 205 // 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 206 // 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. 207 // update several settings then calling Set* methods one by one.
196 virtual void UpdateTouchpadSettings(const TouchpadSettings& settings) = 0; 208 virtual void UpdateTouchpadSettings(const TouchpadSettings& settings) = 0;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 250
239 private: 251 private:
240 virtual void SetInternalTouchpadEnabled(bool enabled) {} 252 virtual void SetInternalTouchpadEnabled(bool enabled) {}
241 virtual void SetTouchscreensEnabled(bool enabled) {} 253 virtual void SetTouchscreensEnabled(bool enabled) {}
242 }; 254 };
243 255
244 } // namespace system 256 } // namespace system
245 } // namespace chromeos 257 } // namespace chromeos
246 258
247 #endif // CHROME_BROWSER_CHROMEOS_SYSTEM_INPUT_DEVICE_SETTINGS_H_ 259 #endif // CHROME_BROWSER_CHROMEOS_SYSTEM_INPUT_DEVICE_SETTINGS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698