Index: ui/base/touch/touch_enabled.cc |
diff --git a/ui/base/touch/touch_enabled.cc b/ui/base/touch/touch_enabled.cc |
index 89d3eac9fd4beda81278e9e9c69baca6735a3803..ee14a77c460835b19ce47e665fa39890ddcb8ab5 100644 |
--- a/ui/base/touch/touch_enabled.cc |
+++ b/ui/base/touch/touch_enabled.cc |
@@ -3,6 +3,7 @@ |
// found in the LICENSE file. |
#include "ui/base/touch/touch_enabled.h" |
+ |
#include "base/command_line.h" |
#include "base/logging.h" |
#include "ui/base/touch/touch_device.h" |
@@ -11,7 +12,24 @@ |
namespace ui { |
+#if defined(OS_CHROMEOS) |
+ |
+namespace { |
+ |
+bool g_touch_events_enabled = true; |
oshima
2015/10/29 23:38:43
i'll leave this for owner, but I'd avoid using g_
afakhry
2015/10/30 05:18:03
Yes it can be arguable. I meant it's global to thi
oshima
2015/10/31 00:27:49
global and file scoped variable have well defined
afakhry
2015/11/03 18:02:55
Removed the g_ and moved these two functions to ba
|
+ |
+} // namespace |
+ |
+void SetTouchEventsEnabled(bool enabled) { |
+ g_touch_events_enabled = enabled; |
+} |
+ |
+#endif // defined(OS_CHROMEOS) |
+ |
bool AreTouchEventsEnabled() { |
+#if defined(OS_CHROMEOS) |
+ return g_touch_events_enabled; |
+#else |
const base::CommandLine& command_line = |
*base::CommandLine::ForCurrentProcess(); |
const std::string touch_enabled_switch = |
@@ -27,6 +45,7 @@ bool AreTouchEventsEnabled() { |
if (touch_enabled_switch != switches::kTouchEventsDisabled) |
LOG(ERROR) << "Invalid --touch-events option: " << touch_enabled_switch; |
return false; |
+#endif // defined(OS_CHROMEOS) |
} |
} // namespace ui |