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

Unified Diff: ui/events/gesture_detection/gesture_config_helper_android.cc

Issue 340343013: Provide max gesture bounds and option to ignore touch size during pinch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix DCHECK 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
Index: ui/events/gesture_detection/gesture_config_helper_android.cc
diff --git a/ui/events/gesture_detection/gesture_config_helper_android.cc b/ui/events/gesture_detection/gesture_config_helper_android.cc
index 546cb84e1193635965d49523fcc19fc4a1da1226..d5073f45b11d1604bbd69f8ec924ace20b365d0d 100644
--- a/ui/events/gesture_detection/gesture_config_helper_android.cc
+++ b/ui/events/gesture_detection/gesture_config_helper_android.cc
@@ -17,6 +17,10 @@ namespace {
// detection pipeline.
const float kMinGestureBoundsLengthDips = 24.f;
+// This value is somewhat arbitrary, but provides a reasonable maximum
+// approximating a large thumb depression.
+const float kMaxGestureBoundsLengthDips = kMinGestureBoundsLengthDips * 4.f;
+
GestureDetector::Config DefaultGestureDetectorConfig(
const gfx::Display& display) {
GestureDetector::Config config;
@@ -53,6 +57,8 @@ ScaleGestureDetector::Config DefaultScaleGestureDetectorConfig(
ViewConfiguration::GetMinScalingTouchMajorInPixels() * px_to_dp;
config.min_scaling_span =
ViewConfiguration::GetMinScalingSpanInPixels() * px_to_dp;
+ config.use_touch_major_in_span =
+ ViewConfiguration::GetTouchMajorUsedInScalingSpan();
return config;
}
@@ -67,6 +73,7 @@ GestureProvider::Config DefaultGestureProviderConfig() {
DefaultScaleGestureDetectorConfig(config.display);
config.gesture_begin_end_types_enabled = false;
config.min_gesture_bounds_length = kMinGestureBoundsLengthDips;
+ config.max_gesture_bounds_length = kMaxGestureBoundsLengthDips;
return config;
}

Powered by Google App Engine
This is Rietveld 408576698