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

Unified Diff: ui/events/gestures/unified_gesture_detector_enabled.cc

Issue 328733003: Fix slop region boundary handling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months 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
« no previous file with comments | « ui/events/gestures/unified_gesture_detector_enabled.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/gestures/unified_gesture_detector_enabled.cc
diff --git a/ui/events/gestures/unified_gesture_detector_enabled.cc b/ui/events/gestures/unified_gesture_detector_enabled.cc
new file mode 100644
index 0000000000000000000000000000000000000000..409f27737a12a91085080e02b96043b38bca57d7
--- /dev/null
+++ b/ui/events/gestures/unified_gesture_detector_enabled.cc
@@ -0,0 +1,37 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/command_line.h"
+#include "base/logging.h"
+#include "ui/events/event_switches.h"
+#include "ui/events/gestures/unified_gesture_detector_enabled.h"
+
+namespace ui {
+
+bool IsUnifiedGestureDetectorEnabled() {
+ const bool kUseUnifiedGestureDetectorByDefault = true;
+
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess();
+ const std::string unified_gd_enabled_switch =
+ command_line.HasSwitch(switches::kUnifiedGestureDetector) ?
+ command_line.GetSwitchValueASCII(switches::kUnifiedGestureDetector) :
+ switches::kUnifiedGestureDetectorAuto;
+
+ if (unified_gd_enabled_switch.empty() ||
+ unified_gd_enabled_switch == switches::kUnifiedGestureDetectorEnabled) {
+ return true;
+ } else if (unified_gd_enabled_switch ==
jdduke (slow) 2014/06/10 16:01:23 Nit: No need for else if / else with preceding ret
tdresser 2014/06/10 16:41:14 Cleaned up the if / else stuff. I think the explic
+ switches::kUnifiedGestureDetectorDisabled) {
+ return false;
+ } else if (unified_gd_enabled_switch ==
+ switches::kUnifiedGestureDetectorAuto) {
+ return kUseUnifiedGestureDetectorByDefault;
+ } else {
+ LOG(ERROR) << "Invalid --unified-gesture-detector option: "
+ << unified_gd_enabled_switch;
+ return false;
+ }
+}
+
+} // namespace ui
« no previous file with comments | « ui/events/gestures/unified_gesture_detector_enabled.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698