diff options
author | jdduke@chromium.org <jdduke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-13 07:46:08 +0000 |
---|---|---|
committer | jdduke@chromium.org <jdduke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-13 07:46:08 +0000 |
commit | f7f7a8adfcb77091ee02c586b7e5d5739ac80c9b (patch) | |
tree | 73794850d9ed02ec4adccccca090e9ed59a91d58 /ui/events | |
parent | bbb1007532bda442f71c6729d2369a2cab2ea36f (diff) | |
download | chromium_src-f7f7a8adfcb77091ee02c586b7e5d5739ac80c9b.zip chromium_src-f7f7a8adfcb77091ee02c586b7e5d5739ac80c9b.tar.gz chromium_src-f7f7a8adfcb77091ee02c586b7e5d5739ac80c9b.tar.bz2 |
[Android] Address spurious scale detection issues
Certain device constants for scale detection interact poorly with large or
variable touch sizes. Fix this by explicitly suppressing pinch detection if
there is but one active touch point. Also address an issue where the first
touch sequence seen after ScaleGestureDetector creation would trigger a scale
event because of improper NaN initialization. Finally, port the latest update
from the Android platform GestureDetector for suppressing double-taps (including
double-tap drag zooms) if the time delay between the first pointer up and the
second pointer down is sufficiently short.
BUG=376618,382209,340263
Review URL: https://codereview.chromium.org/330723002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@276965 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/events')
7 files changed, 164 insertions, 30 deletions
diff --git a/ui/events/gesture_detection/gesture_detector.cc b/ui/events/gesture_detection/gesture_detector.cc index 8ceffba..82db0ca 100644 --- a/ui/events/gesture_detection/gesture_detector.cc +++ b/ui/events/gesture_detection/gesture_detector.cc @@ -42,6 +42,7 @@ GestureDetector::Config::Config() : longpress_timeout(base::TimeDelta::FromMilliseconds(500)), showpress_timeout(base::TimeDelta::FromMilliseconds(180)), double_tap_timeout(base::TimeDelta::FromMilliseconds(300)), + double_tap_min_time(base::TimeDelta::FromMilliseconds(40)), touch_slop(8), double_tap_slop(100), minimum_fling_velocity(50), @@ -461,6 +462,8 @@ void GestureDetector::Init(const Config& config) { double_tap_touch_slop_square_ = double_tap_touch_slop * double_tap_touch_slop; double_tap_slop_square_ = double_tap_slop * double_tap_slop; double_tap_timeout_ = config.double_tap_timeout; + double_tap_min_time_ = config.double_tap_min_time; + DCHECK(double_tap_min_time_ < double_tap_timeout_); min_fling_velocity_ = config.minimum_fling_velocity; max_fling_velocity_ = config.maximum_fling_velocity; @@ -520,8 +523,9 @@ bool GestureDetector::IsConsideredDoubleTap( if (!always_in_bigger_tap_region_) return false; - if (second_down.GetEventTime() - first_up.GetEventTime() > - double_tap_timeout_) + const base::TimeDelta delta_time = + second_down.GetEventTime() - first_up.GetEventTime(); + if (delta_time < double_tap_min_time_ || delta_time > double_tap_timeout_) return false; const float delta_x = first_down.GetX() - second_down.GetX(); diff --git a/ui/events/gesture_detection/gesture_detector.h b/ui/events/gesture_detection/gesture_detector.h index 39a5542..786f3dc 100644 --- a/ui/events/gesture_detection/gesture_detector.h +++ b/ui/events/gesture_detection/gesture_detector.h @@ -28,6 +28,10 @@ class GestureDetector { base::TimeDelta showpress_timeout; base::TimeDelta double_tap_timeout; + // The minimum duration between the first tap's up event and the second + // tap's down event for an interaction to be considered a double-tap. + base::TimeDelta double_tap_min_time; + // Distance a touch can wander before a scroll will occur (in dips). float touch_slop; @@ -174,6 +178,7 @@ class GestureDetector { float min_swipe_direction_component_ratio_; base::TimeDelta double_tap_timeout_; base::TimeDelta two_finger_tap_timeout_; + base::TimeDelta double_tap_min_time_; bool still_down_; bool defer_confirm_single_tap_; diff --git a/ui/events/gesture_detection/gesture_provider_unittest.cc b/ui/events/gesture_detection/gesture_provider_unittest.cc index 7417e7e..0e36ed0 100644 --- a/ui/events/gesture_detection/gesture_provider_unittest.cc +++ b/ui/events/gesture_detection/gesture_provider_unittest.cc @@ -43,6 +43,10 @@ GestureProvider::Config CreateDefaultConfig() { // microseconds simply to allow several intermediate events to occur before // the second tap at microsecond intervals. sConfig.gesture_detector_config.double_tap_timeout = kOneMicrosecond * 4; + sConfig.gesture_detector_config.double_tap_min_time = kOneMicrosecond * 2; + + sConfig.scale_gesture_detector_config.gesture_detector_config = + sConfig.gesture_detector_config; return sConfig; } @@ -189,6 +193,10 @@ class GestureProviderTest : public testing::Test, public GestureProviderClient { return GetDefaultConfig().gesture_detector_config.touch_slop; } + float GetMinScalingSpan() const { + return GetDefaultConfig().scale_gesture_detector_config.min_scaling_span; + } + float GetMinSwipeVelocity() const { return GetDefaultConfig().gesture_detector_config.minimum_swipe_velocity; } @@ -205,6 +213,14 @@ class GestureProviderTest : public testing::Test, public GestureProviderClient { return GetDefaultConfig().gesture_detector_config.double_tap_timeout; } + base::TimeDelta GetDoubleTapMinTime() const { + return GetDefaultConfig().gesture_detector_config.double_tap_min_time; + } + + base::TimeDelta GetValidDoubleTapDelay() const { + return (GetDoubleTapTimeout() + GetDoubleTapMinTime()) / 2; + } + void EnableBeginEndTypes() { GestureProvider::Config config = GetDefaultConfig(); config.gesture_begin_end_types_enabled = true; @@ -619,7 +635,8 @@ TEST_F(GestureProviderTest, DoubleTap) { EXPECT_EQ(ET_GESTURE_TAP_UNCONFIRMED, GetMostRecentGestureEventType()); EXPECT_EQ(1, GetMostRecentGestureEvent().details.touch_points()); - event = ObtainMotionEvent(event_time + kOneMicrosecond * 2, + event_time += GetValidDoubleTapDelay(); + event = ObtainMotionEvent(event_time, MotionEvent::ACTION_DOWN, kFakeCoordX, kFakeCoordY); @@ -629,7 +646,7 @@ TEST_F(GestureProviderTest, DoubleTap) { // Moving a very small amount of distance should not trigger the double tap // drag zoom mode. - event = ObtainMotionEvent(event_time + kOneMicrosecond * 3, + event = ObtainMotionEvent(event_time + kOneMicrosecond, MotionEvent::ACTION_MOVE, kFakeCoordX, kFakeCoordY + 1); @@ -637,7 +654,7 @@ TEST_F(GestureProviderTest, DoubleTap) { EXPECT_EQ(ET_GESTURE_TAP_DOWN, GetMostRecentGestureEventType()); EXPECT_EQ(1, GetMostRecentGestureEvent().details.touch_points()); - event = ObtainMotionEvent(event_time + kOneMicrosecond * 3, + event = ObtainMotionEvent(event_time + kOneMicrosecond * 2, MotionEvent::ACTION_UP, kFakeCoordX, kFakeCoordY + 1); @@ -653,7 +670,7 @@ TEST_F(GestureProviderTest, DoubleTap) { TEST_F(GestureProviderTest, DoubleTapDragZoomBasic) { const base::TimeTicks down_time_1 = TimeTicks::Now(); - const base::TimeTicks down_time_2 = down_time_1 + kOneMicrosecond * 2; + const base::TimeTicks down_time_2 = down_time_1 + GetValidDoubleTapDelay(); MockMotionEvent event = ObtainMotionEvent(down_time_1, MotionEvent::ACTION_DOWN); @@ -936,7 +953,8 @@ TEST_F(GestureProviderTest, NoGestureLongPressDuringDoubleTap) { EXPECT_EQ(ET_GESTURE_TAP_UNCONFIRMED, GetMostRecentGestureEventType()); EXPECT_EQ(1, GetMostRecentGestureEvent().details.touch_points()); - event = ObtainMotionEvent(event_time + kOneMicrosecond, + event_time += GetValidDoubleTapDelay(); + event = ObtainMotionEvent(event_time, MotionEvent::ACTION_DOWN, kFakeCoordX, kFakeCoordY); @@ -1049,6 +1067,43 @@ TEST_F(GestureProviderTest, NoScrollWithinTouchSlop) { EXPECT_TRUE(HasReceivedGesture(ET_GESTURE_SCROLL_BEGIN)); } +TEST_F(GestureProviderTest, NoDoubleTapWhenTooRapid) { + base::TimeTicks event_time = base::TimeTicks::Now(); + + MockMotionEvent event = + ObtainMotionEvent(event_time, MotionEvent::ACTION_DOWN); + EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); + + EXPECT_EQ(ET_GESTURE_TAP_DOWN, GetMostRecentGestureEventType()); + EXPECT_EQ(1, GetMostRecentGestureEvent().details.touch_points()); + + event = ObtainMotionEvent(event_time + kOneMicrosecond, + MotionEvent::ACTION_UP, + kFakeCoordX, + kFakeCoordY); + gesture_provider_->OnTouchEvent(event); + EXPECT_EQ(ET_GESTURE_TAP_UNCONFIRMED, GetMostRecentGestureEventType()); + EXPECT_EQ(1, GetMostRecentGestureEvent().details.touch_points()); + + // If the second tap follows the first in too short a time span, no double-tap + // will occur. + event_time += (GetDoubleTapMinTime() / 2); + event = ObtainMotionEvent(event_time, + MotionEvent::ACTION_DOWN, + kFakeCoordX, + kFakeCoordY); + EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); + EXPECT_EQ(ET_GESTURE_TAP_DOWN, GetMostRecentGestureEventType()); + EXPECT_EQ(1, GetMostRecentGestureEvent().details.touch_points()); + + event = ObtainMotionEvent(event_time + kOneMicrosecond, + MotionEvent::ACTION_UP, + kFakeCoordX, + kFakeCoordY); + EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); + EXPECT_EQ(ET_GESTURE_TAP_UNCONFIRMED, GetMostRecentGestureEventType()); +} + TEST_F(GestureProviderTest, NoDoubleTapWhenExplicitlyDisabled) { // Ensure that double-tap gestures can be disabled. gesture_provider_->SetDoubleTapSupportForPlatformEnabled(false); @@ -1066,14 +1121,15 @@ TEST_F(GestureProviderTest, NoDoubleTapWhenExplicitlyDisabled) { EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); EXPECT_EQ(ET_GESTURE_TAP, GetMostRecentGestureEventType()); - event = ObtainMotionEvent(event_time + kOneMicrosecond * 2, + event_time += GetValidDoubleTapDelay(); + event = ObtainMotionEvent(event_time, MotionEvent::ACTION_DOWN, kFakeCoordX, kFakeCoordY); EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); EXPECT_EQ(ET_GESTURE_TAP_DOWN, GetMostRecentGestureEventType()); - event = ObtainMotionEvent(event_time + kOneMicrosecond * 3, + event = ObtainMotionEvent(event_time + kOneMicrosecond, MotionEvent::ACTION_UP, kFakeCoordX, kFakeCoordY); @@ -1102,28 +1158,30 @@ TEST_F(GestureProviderTest, NoDoubleTapWhenExplicitlyDisabled) { // Ensure that double-tap gestures can be resumed. gesture_provider_->SetDoubleTapSupportForPlatformEnabled(true); - event = ObtainMotionEvent(event_time + kOneMicrosecond * 2, + event_time += GetValidDoubleTapDelay(); + event = ObtainMotionEvent(event_time, MotionEvent::ACTION_DOWN, kFakeCoordX, kFakeCoordY); EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); EXPECT_EQ(ET_GESTURE_TAP_DOWN, GetMostRecentGestureEventType()); - event = ObtainMotionEvent(event_time + kOneMicrosecond * 3, + event = ObtainMotionEvent(event_time + kOneMicrosecond, MotionEvent::ACTION_UP, kFakeCoordX, kFakeCoordY); EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); EXPECT_EQ(ET_GESTURE_TAP_UNCONFIRMED, GetMostRecentGestureEventType()); - event = ObtainMotionEvent(event_time + kOneMicrosecond * 4, + event_time += GetValidDoubleTapDelay(); + event = ObtainMotionEvent(event_time, MotionEvent::ACTION_DOWN, kFakeCoordX, kFakeCoordY); EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); EXPECT_EQ(ET_GESTURE_TAP_DOWN, GetMostRecentGestureEventType()); - event = ObtainMotionEvent(event_time + kOneMicrosecond * 5, + event = ObtainMotionEvent(event_time + kOneMicrosecond, MotionEvent::ACTION_UP, kFakeCoordX, kFakeCoordY); @@ -1163,7 +1221,7 @@ TEST_F(GestureProviderTest, NoDelayedTapWhenDoubleTapSupportToggled) { TEST_F(GestureProviderTest, NoDoubleTapDragZoomWhenDisabledOnPlatform) { const base::TimeTicks down_time_1 = TimeTicks::Now(); - const base::TimeTicks down_time_2 = down_time_1 + kOneMicrosecond * 2; + const base::TimeTicks down_time_2 = down_time_1 + GetValidDoubleTapDelay(); gesture_provider_->SetDoubleTapSupportForPlatformEnabled(false); @@ -1215,7 +1273,7 @@ TEST_F(GestureProviderTest, NoDoubleTapDragZoomWhenDisabledOnPlatform) { // The second tap sequence should be treated just as the first would be. TEST_F(GestureProviderTest, NoDoubleTapDragZoomWhenDisabledOnPage) { const base::TimeTicks down_time_1 = TimeTicks::Now(); - const base::TimeTicks down_time_2 = down_time_1 + kOneMicrosecond * 2; + const base::TimeTicks down_time_2 = down_time_1 + GetValidDoubleTapDelay(); gesture_provider_->SetDoubleTapSupportForPageEnabled(false); @@ -1264,7 +1322,7 @@ TEST_F(GestureProviderTest, NoDoubleTapDragZoomWhenDisabledOnPage) { // disables double tap detection after the gesture has ended. TEST_F(GestureProviderTest, FixedPageScaleDuringDoubleTapDragZoom) { base::TimeTicks down_time_1 = TimeTicks::Now(); - base::TimeTicks down_time_2 = down_time_1 + kOneMicrosecond * 2; + base::TimeTicks down_time_2 = down_time_1 + GetValidDoubleTapDelay(); gesture_provider_->SetDoubleTapSupportForPageEnabled(true); gesture_provider_->SetDoubleTapSupportForPlatformEnabled(true); @@ -1480,6 +1538,48 @@ TEST_F(GestureProviderTest, PinchZoom) { GetMostRecentGestureEvent().details.bounding_box()); } +// Verify that no accidental pinching occurs if the touch size is large relative +// to the min scaling span. +TEST_F(GestureProviderTest, NoPinchZoomWithFatFinger) { + base::TimeTicks event_time = base::TimeTicks::Now(); + const float kFatFingerSize = GetMinScalingSpan() * 3.f; + + gesture_provider_->SetDoubleTapSupportForPlatformEnabled(false); + gesture_provider_->SetMultiTouchZoomSupportEnabled(true); + + MockMotionEvent event = + ObtainMotionEvent(event_time, MotionEvent::ACTION_DOWN); + EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); + EXPECT_EQ(ET_GESTURE_TAP_DOWN, GetMostRecentGestureEventType()); + EXPECT_EQ(1U, GetReceivedGestureCount()); + + event = ObtainMotionEvent(event_time + kOneSecond, + MotionEvent::ACTION_MOVE); + event.SetTouchMajor(0.1f); + EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); + EXPECT_EQ(1U, GetReceivedGestureCount()); + + event = ObtainMotionEvent(event_time + kOneSecond * 2, + MotionEvent::ACTION_MOVE, + kFakeCoordX + 1.f, + kFakeCoordY); + event.SetTouchMajor(1.f); + EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); + EXPECT_EQ(1U, GetReceivedGestureCount()); + + event = ObtainMotionEvent(event_time + kOneSecond * 3, + MotionEvent::ACTION_MOVE); + event.SetTouchMajor(kFatFingerSize * 3.5f); + EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); + EXPECT_EQ(1U, GetReceivedGestureCount()); + + event = ObtainMotionEvent(event_time + kOneSecond * 4, + MotionEvent::ACTION_MOVE); + event.SetTouchMajor(kFatFingerSize * 5.f); + EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); + EXPECT_EQ(1U, GetReceivedGestureCount()); +} + // Verify that multi-finger swipe sends the proper event sequence. TEST_F(GestureProviderTest, MultiFingerSwipe) { EnableSwipe(); @@ -1670,7 +1770,7 @@ TEST_F(GestureProviderTest, CancelActiveTouchSequence) { TEST_F(GestureProviderTest, DoubleTapDragZoomCancelledOnSecondaryPointerDown) { const base::TimeTicks down_time_1 = TimeTicks::Now(); - const base::TimeTicks down_time_2 = down_time_1 + kOneMicrosecond * 2; + const base::TimeTicks down_time_2 = down_time_1 + GetValidDoubleTapDelay(); gesture_provider_->SetDoubleTapSupportForPlatformEnabled(true); diff --git a/ui/events/gesture_detection/mock_motion_event.cc b/ui/events/gesture_detection/mock_motion_event.cc index 54d7b02..16620c9 100644 --- a/ui/events/gesture_detection/mock_motion_event.cc +++ b/ui/events/gesture_detection/mock_motion_event.cc @@ -11,16 +11,22 @@ using base::TimeTicks; namespace ui { MockMotionEvent::MockMotionEvent() - : action(ACTION_CANCEL), pointer_count(1), id(0) {} + : action(ACTION_CANCEL), pointer_count(1), touch_major(TOUCH_MAJOR), id(0) { +} MockMotionEvent::MockMotionEvent(Action action) - : action(action), pointer_count(1), id(0) {} + : action(action), pointer_count(1), touch_major(TOUCH_MAJOR), id(0) { +} MockMotionEvent::MockMotionEvent(Action action, TimeTicks time, float x, float y) - : action(action), pointer_count(1), time(time), id(0) { + : action(action), + pointer_count(1), + time(time), + touch_major(TOUCH_MAJOR), + id(0) { points[0].SetPoint(x, y); } @@ -30,7 +36,11 @@ MockMotionEvent::MockMotionEvent(Action action, float y0, float x1, float y1) - : action(action), pointer_count(2), time(time), id(0) { + : action(action), + pointer_count(2), + time(time), + touch_major(TOUCH_MAJOR), + id(0) { points[0].SetPoint(x0, y0); points[1].SetPoint(x1, y1); } @@ -43,7 +53,11 @@ MockMotionEvent::MockMotionEvent(Action action, float y1, float x2, float y2) - : action(action), pointer_count(3), time(time), id(0) { + : action(action), + pointer_count(3), + time(time), + touch_major(TOUCH_MAJOR), + id(0) { points[0].SetPoint(x0, y0); points[1].SetPoint(x1, y1); points[2].SetPoint(x2, y2); @@ -53,6 +67,7 @@ MockMotionEvent::MockMotionEvent(const MockMotionEvent& other) : action(other.action), pointer_count(other.pointer_count), time(other.time), + touch_major(other.touch_major), id(other.GetId()) { for (size_t i = 0; i < pointer_count; ++i) points[i] = other.points[i]; @@ -86,7 +101,7 @@ float MockMotionEvent::GetY(size_t pointer_index) const { } float MockMotionEvent::GetTouchMajor(size_t pointer_index) const { - return TOUCH_MAJOR; + return touch_major; } float MockMotionEvent::GetPressure(size_t pointer_index) const { @@ -169,4 +184,8 @@ void MockMotionEvent::CancelPoint() { action = ACTION_CANCEL; } +void MockMotionEvent::SetTouchMajor(float new_touch_major) { + touch_major = new_touch_major; +} + } // namespace ui diff --git a/ui/events/gesture_detection/mock_motion_event.h b/ui/events/gesture_detection/mock_motion_event.h index 3cff718..67f8d3b 100644 --- a/ui/events/gesture_detection/mock_motion_event.h +++ b/ui/events/gesture_detection/mock_motion_event.h @@ -69,10 +69,13 @@ struct MockMotionEvent : public MotionEvent { void MovePoint(size_t index, float x, float y); void ReleasePoint(); void CancelPoint(); + void SetTouchMajor(float new_touch_major); + MotionEvent::Action action; size_t pointer_count; gfx::PointF points[MAX_POINTERS]; base::TimeTicks time; + float touch_major; int id; }; diff --git a/ui/events/gesture_detection/scale_gesture_detector.cc b/ui/events/gesture_detection/scale_gesture_detector.cc index 3f8ba17..18fd6d8 100644 --- a/ui/events/gesture_detection/scale_gesture_detector.cc +++ b/ui/events/gesture_detection/scale_gesture_detector.cc @@ -83,6 +83,7 @@ ScaleGestureDetector::ScaleGestureDetector(const Config& config, (config.gesture_detector_config.touch_slop + kSlopEpsilon) * 2; touch_min_major_ = config.min_scaling_touch_major; min_span_ = config.min_scaling_span + kSlopEpsilon; + ResetTouchHistory(); SetQuickScaleEnabled(config.quick_scale_enabled); } @@ -116,7 +117,7 @@ bool ScaleGestureDetector::OnTouchEvent(const MotionEvent& event) { } if (stream_complete) { - ClearTouchHistory(); + ResetTouchHistory(); return true; } } @@ -206,7 +207,7 @@ bool ScaleGestureDetector::OnTouchEvent(const MotionEvent& event) { } const float min_span = InDoubleTapMode() ? span_slop_ : min_span_; - if (!in_progress_ && span >= min_span && + if (!in_progress_ && span >= min_span && (InDoubleTapMode() || count > 1) && (was_in_progress || std::abs(span - initial_span_) > span_slop_)) { prev_span_x_ = curr_span_x_ = span_x; prev_span_y_ = curr_span_y_ = span_y; @@ -306,10 +307,12 @@ bool ScaleGestureDetector::OnDoubleTap(const MotionEvent& ev) { } void ScaleGestureDetector::AddTouchHistory(const MotionEvent& ev) { - const base::TimeTicks current_time = base::TimeTicks::Now(); + const base::TimeTicks current_time = ev.GetEventTime(); + DCHECK(!current_time.is_null()); const int count = static_cast<int>(ev.GetPointerCount()); - bool accept = (current_time - touch_history_last_accepted_time_) - .InMilliseconds() >= kTouchStabilizeTimeMs; + bool accept = touch_history_last_accepted_time_.is_null() || + (current_time - touch_history_last_accepted_time_) >= + base::TimeDelta::FromMilliseconds(kTouchStabilizeTimeMs); float total = 0; int sample_count = 0; for (int i = 0; i < count; i++) { @@ -363,7 +366,7 @@ void ScaleGestureDetector::AddTouchHistory(const MotionEvent& ev) { } } -void ScaleGestureDetector::ClearTouchHistory() { +void ScaleGestureDetector::ResetTouchHistory() { touch_upper_ = std::numeric_limits<float>::quiet_NaN(); touch_lower_ = std::numeric_limits<float>::quiet_NaN(); touch_history_last_accepted_ = std::numeric_limits<float>::quiet_NaN(); diff --git a/ui/events/gesture_detection/scale_gesture_detector.h b/ui/events/gesture_detection/scale_gesture_detector.h index e2de266..b07f78d 100644 --- a/ui/events/gesture_detection/scale_gesture_detector.h +++ b/ui/events/gesture_detection/scale_gesture_detector.h @@ -109,7 +109,7 @@ class ScaleGestureDetector : public GestureDetector::SimpleGestureListener { // The TouchMajor/TouchMinor elements of a MotionEvent can flutter/jitter on // some hardware/driver combos. Smooth out to get kinder, gentler behavior. void AddTouchHistory(const MotionEvent& ev); - void ClearTouchHistory(); + void ResetTouchHistory(); void ResetScaleWithSpan(float span); |