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

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

Issue 189583007: Ensure Multi-finger tap generates both GestureScrollBegin and GestureScrollEnd. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Factor out scroll start logic. Created 6 years, 9 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/gesture_sequence.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/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
« no previous file with comments | « ui/events/gestures/gesture_sequence.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698