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

Unified Diff: ui/events/base_event_utils.cc

Issue 1453813003: Fix a regression in checking the status of the touch events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use the master switch on ozone as well. Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: ui/events/base_event_utils.cc
diff --git a/ui/events/base_event_utils.cc b/ui/events/base_event_utils.cc
index 622d2f206179bf0886a1ffc7110366ab16e4abbc..846b6dfabc82f15328bd777db312d61c763146c4 100644
--- a/ui/events/base_event_utils.cc
+++ b/ui/events/base_event_utils.cc
@@ -21,30 +21,6 @@ bool touch_events_enabled = true;
const int kSystemKeyModifierMask = EF_ALT_DOWN | EF_COMMAND_DOWN;
#else
const int kSystemKeyModifierMask = EF_ALT_DOWN;
-
-// Retrieves the status of the touch screen events from the command line on Non-
-// ChromeOS platforms.
-bool ComputeTouchStatus() {
- const base::CommandLine& command_line =
- *base::CommandLine::ForCurrentProcess();
- const std::string touch_enabled_switch =
- command_line.HasSwitch(switches::kTouchEvents) ?
- command_line.GetSwitchValueASCII(switches::kTouchEvents) :
- switches::kTouchEventsAuto;
-
- if (touch_enabled_switch.empty() ||
- touch_enabled_switch == switches::kTouchEventsEnabled ||
- touch_enabled_switch == switches::kTouchEventsAuto) {
- return true;
- }
-
- if (touch_enabled_switch == switches::kTouchEventsDisabled)
- return false;
-
- LOG(ERROR) << "Invalid --touch-events option: " << touch_enabled_switch;
- return false;
-}
-
#endif // defined(OS_CHROMEOS)
} // namespace
@@ -70,20 +46,15 @@ bool IsSystemKeyModifier(int flags) {
#if defined(OS_CHROMEOS)
-void SetTouchEventsEnabled(bool enabled) {
+void SetTouchEventsCrOsMasterSwitch(bool enabled) {
touch_events_enabled = enabled;
}
-#endif // defined(OS_CHROMEOS)
-
-bool AreTouchEventsEnabled() {
-#if defined(OS_CHROMEOS)
- return touch_events_enabled;
-#else
- static bool touch_events_enabled = ComputeTouchStatus();
+bool GetTouchEventsCrOsMasterSwitch() {
return touch_events_enabled;
-#endif // !defined(OS_CHROMEOS)
}
+#endif // defined(OS_CHROMEOS)
+
} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698