Index: ui/events/gestures/gesture_sequence.cc |
diff --git a/ui/events/gestures/gesture_sequence.cc b/ui/events/gestures/gesture_sequence.cc |
index 5ee5d5e53fbe6204b204c0755773fd60bf4fbd1c..b9f7e6e97917962740cc89711528f2c81a08617d 100644 |
--- a/ui/events/gestures/gesture_sequence.cc |
+++ b/ui/events/gestures/gesture_sequence.cc |
@@ -633,7 +633,7 @@ GestureSequence::Gestures* GestureSequence::ProcessTouchEventForGesture( |
case GST_PENDING_TWO_FINGER_TAP_FIRST_RELEASED: |
case GST_PENDING_TWO_FINGER_TAP_SECOND_RELEASED: |
TwoFingerTouchReleased(event, point, gestures.get()); |
- set_state(GS_SCROLL); |
+ StartRailFreeScroll(point, gestures.get()); |
break; |
case GST_PENDING_TWO_FINGER_TAP_FIRST_MOVED: |
case GST_PENDING_TWO_FINGER_TAP_SECOND_MOVED: |
@@ -648,8 +648,7 @@ GestureSequence::Gestures* GestureSequence::ProcessTouchEventForGesture( |
case GST_PENDING_TWO_FINGER_TAP_SECOND_RELEASED_HANDLED: |
case GST_PENDING_TWO_FINGER_TAP_FIRST_CANCELLED: |
case GST_PENDING_TWO_FINGER_TAP_SECOND_CANCELLED: |
- scroll_type_ = ST_FREE; |
- set_state(GS_SCROLL); |
+ StartRailFreeScroll(point, gestures.get()); |
break; |
case GST_PENDING_TWO_FINGER_TAP_THIRD_PRESSED: |
set_state(GS_PENDING_PINCH); |
@@ -661,18 +660,17 @@ GestureSequence::Gestures* GestureSequence::ProcessTouchEventForGesture( |
case GST_PENDING_TWO_FINGER_TAP_NO_PINCH_FIRST_RELEASED: |
case GST_PENDING_TWO_FINGER_TAP_NO_PINCH_SECOND_RELEASED: |
TwoFingerTouchReleased(event, point, gestures.get()); |
- // We transit into GS_SCROLL even though the touch move can be |
- // consumed and no scroll should happen. crbug.com/240399. |
- set_state(GS_SCROLL); |
+ // We transition into GS_SCROLL even though the touch move can be consumed |
+ // and no scroll should happen. crbug.com/240399. |
+ StartRailFreeScroll(point, gestures.get()); |
break; |
case GST_PENDING_TWO_FINGER_TAP_NO_PINCH_FIRST_RELEASED_HANDLED: |
case GST_PENDING_TWO_FINGER_TAP_NO_PINCH_SECOND_RELEASED_HANDLED: |
case GST_PENDING_TWO_FINGER_TAP_NO_PINCH_FIRST_CANCELLED: |
case GST_PENDING_TWO_FINGER_TAP_NO_PINCH_SECOND_CANCELLED: |
- // We transit into GS_SCROLL even though the touch move can be |
- // consumed and no scroll should happen. crbug.com/240399. |
- scroll_type_ = ST_FREE; |
- set_state(GS_SCROLL); |
+ // We transition into GS_SCROLL even though the touch move can be consumed |
+ // and no scroll should happen. crbug.com/240399. |
+ StartRailFreeScroll(point, gestures.get()); |
break; |
case GST_PENDING_PINCH_FIRST_MOVED: |
case GST_PENDING_PINCH_SECOND_MOVED: |
@@ -687,10 +685,9 @@ GestureSequence::Gestures* GestureSequence::ProcessTouchEventForGesture( |
case GST_PENDING_PINCH_SECOND_RELEASED: |
case GST_PENDING_PINCH_FIRST_CANCELLED: |
case GST_PENDING_PINCH_SECOND_CANCELLED: |
- // We transit into GS_SCROLL even though the touch move can be |
- // consumed and no scroll should happen. crbug.com/240399. |
- scroll_type_ = ST_FREE; |
- set_state(GS_SCROLL); |
+ // We transition into GS_SCROLL even though the touch move can be consumed |
+ // and no scroll should happen. crbug.com/240399. |
+ StartRailFreeScroll(point, gestures.get()); |
break; |
case GST_PENDING_PINCH_NO_PINCH_FIRST_MOVED: |
case GST_PENDING_PINCH_NO_PINCH_SECOND_MOVED: |
@@ -700,10 +697,9 @@ GestureSequence::Gestures* GestureSequence::ProcessTouchEventForGesture( |
case GST_PENDING_PINCH_NO_PINCH_SECOND_RELEASED: |
case GST_PENDING_PINCH_NO_PINCH_FIRST_CANCELLED: |
case GST_PENDING_PINCH_NO_PINCH_SECOND_CANCELLED: |
- // We transit into GS_SCROLL even though the touch move can be |
- // consumed and no scroll should happen. crbug.com/240399. |
- scroll_type_ = ST_FREE; |
- set_state(GS_SCROLL); |
+ // We transition into GS_SCROLL even though the touch move can be consumed |
+ // and no scroll should happen. crbug.com/240399. |
+ StartRailFreeScroll(point, gestures.get()); |
break; |
case GST_PINCH_FIRST_MOVED_HANDLED: |
case GST_PINCH_SECOND_MOVED_HANDLED: |
@@ -1479,4 +1475,11 @@ void GestureSequence::StopTimersIfRequired(const TouchEvent& event) { |
} |
} |
+void GestureSequence::StartRailFreeScroll(const GesturePoint& point, |
+ Gestures* gestures) { |
+ AppendScrollGestureBegin(point, point.first_touch_position(), gestures); |
+ scroll_type_ = ST_FREE; |
+ set_state(GS_SCROLL); |
+} |
+ |
} // namespace ui |