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

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

Issue 660663002: Clear pending events upon main frame navigation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updates Created 6 years, 1 month 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/gesture_detection/gesture_provider.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/gesture_detection/touch_disposition_gesture_filter.cc
diff --git a/ui/events/gesture_detection/touch_disposition_gesture_filter.cc b/ui/events/gesture_detection/touch_disposition_gesture_filter.cc
index fcb92d495d4bca53df5016a50209ccfe95328076..aac14f40ad3abf53fc258abda1bc09ad7ccd4196 100644
--- a/ui/events/gesture_detection/touch_disposition_gesture_filter.cc
+++ b/ui/events/gesture_detection/touch_disposition_gesture_filter.cc
@@ -183,6 +183,7 @@ void TouchDispositionGestureFilter::OnTouchEventAck(bool event_consumed) {
// Dispatch the packet corresponding to the ack'ed touch, as well as any
// additional timeout-based packets queued before the ack was received.
bool touch_packet_for_current_ack_handled = false;
+ bool sequence_cancelled = false;
while (!sequence.empty()) {
DCHECK_NE(sequence.front().gesture_source(),
GestureEventDataPacket::UNDEFINED);
@@ -197,6 +198,8 @@ void TouchDispositionGestureFilter::OnTouchEventAck(bool event_consumed) {
break;
state_.OnTouchEventAck(event_consumed, IsTouchStartEvent(source));
touch_packet_for_current_ack_handled = true;
+ sequence_cancelled =
+ source == GestureEventDataPacket::TOUCH_SEQUENCE_CANCEL;
}
// We need to pop the current sequence before sending the packet, because
// sending the packet could result in this method being re-entered (e.g. on
@@ -206,6 +209,10 @@ void TouchDispositionGestureFilter::OnTouchEventAck(bool event_consumed) {
sequence.pop();
FilterAndSendPacket(packet);
}
+
+ if (sequence.empty() && sequence_cancelled)
+ PopGestureSequence();
+
DCHECK(touch_packet_for_current_ack_handled);
}
« no previous file with comments | « ui/events/gesture_detection/gesture_provider.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698