Index: ui/events/gesture_detection/gesture_provider.cc |
diff --git a/ui/events/gesture_detection/gesture_provider.cc b/ui/events/gesture_detection/gesture_provider.cc |
index 7607f08d8765a7fbc02a96f7eb471af5f813efcb..55bc37010402aad0021a62760f0a07d5d378ca89 100644 |
--- a/ui/events/gesture_detection/gesture_provider.cc |
+++ b/ui/events/gesture_detection/gesture_provider.cc |
@@ -130,7 +130,8 @@ class GestureProvider::ScaleGestureListenerImpl |
: scale_gesture_detector_(config, this), |
provider_(provider), |
ignore_multitouch_events_(false), |
- pinch_event_sent_(false) {} |
+ pinch_event_sent_(false), |
+ min_pinch_update_span_delta_(config.min_pinch_update_span_delta) {} |
bool OnTouchEvent(const MotionEvent& event) { |
// TODO: Need to deal with multi-touch transition. |
@@ -182,6 +183,11 @@ class GestureProvider::ScaleGestureListenerImpl |
GetBoundingBox(e))); |
} |
+ if (std::abs(detector.GetCurrentSpan() - detector.GetPreviousSpan()) < |
+ min_pinch_update_span_delta_) { |
+ return false; |
+ } |
+ |
float scale = detector.GetScaleFactor(); |
if (scale == 1) |
return true; |
@@ -247,6 +253,10 @@ class GestureProvider::ScaleGestureListenerImpl |
// Whether any pinch zoom event has been sent to native. |
bool pinch_event_sent_; |
+ // The minimum change in span required before this is considered a pinch. See |
+ // crbug.com/373318. |
+ float min_pinch_update_span_delta_; |
+ |
DISALLOW_COPY_AND_ASSIGN(ScaleGestureListenerImpl); |
}; |