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

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: dtapuska's comments 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..3ae5923bcb88932a2456ffa9437f5889648a475e 100644
--- a/ui/events/base_event_utils.cc
+++ b/ui/events/base_event_utils.cc
@@ -14,37 +14,15 @@ namespace ui {
namespace {
-#if defined(OS_CHROMEOS)
+#if defined(OS_CHROMEOS) && defined(USE_X11)
// Determines whether touch events are enabled or disabled on ChromeOS only.
bool touch_events_enabled = true;
+#endif // defined(OS_CHROMEOS) && defined(USE_X11)
+#if defined(OS_CHROMEOS)
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
@@ -68,22 +46,17 @@ bool IsSystemKeyModifier(int flags) {
(EF_ALTGR_DOWN & flags) == 0;
}
-#if defined(OS_CHROMEOS)
+#if defined(OS_CHROMEOS) && defined(USE_X11)
-void SetTouchEventsEnabled(bool enabled) {
+void SetTouchEventsCrOsX11MasterSwitch(bool enabled) {
touch_events_enabled = enabled;
}
-#endif // defined(OS_CHROMEOS)
-
-bool AreTouchEventsEnabled() {
-#if defined(OS_CHROMEOS)
+bool GetTouchEventsCrOsX11MasterSwitch() {
return touch_events_enabled;
-#else
- static bool touch_events_enabled = ComputeTouchStatus();
- return touch_events_enabled;
-#endif // !defined(OS_CHROMEOS)
}
+#endif // defined(OS_CHROMEOS) && defined(USE_X11)
+
} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698