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

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

Issue 712133003: Track whether a scroll sequence has been partially prevented (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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
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..564d014a4c5f94c28a7bd9a72be4ec1c8c84d594 100644
--- a/ui/events/gesture_detection/touch_disposition_gesture_filter.cc
+++ b/ui/events/gesture_detection/touch_disposition_gesture_filter.cc
@@ -314,6 +314,15 @@ void TouchDispositionGestureFilter::SendGesture(
ending_event_primary_tool_type_ = event.primary_tool_type;
needs_scroll_ending_event_ = true;
break;
+ case ET_GESTURE_SCROLL_UPDATE:
+ if (state_.HasFilteredGestureType(ET_GESTURE_SCROLL_UPDATE)) {
+ GestureEventData modified_event(ET_GESTURE_SCROLL_UPDATE, event);
+ modified_event.details
+ .mark_previous_scroll_update_in_sequence_prevented();
+ client_->ForwardGestureEvent(modified_event);
+ return;
+ }
+ break;
case ET_GESTURE_SCROLL_END:
needs_scroll_ending_event_ = false;
break;
@@ -418,10 +427,17 @@ bool TouchDispositionGestureFilter::GestureHandlingState::Filter(
last_gesture_of_type_dropped_.has_bit(
GetGestureTypeIndex(antecedent_event_type)))) {
last_gesture_of_type_dropped_.mark_bit(GetGestureTypeIndex(gesture_type));
+ any_gesture_of_type_dropped_.mark_bit(GetGestureTypeIndex(gesture_type));
return true;
}
last_gesture_of_type_dropped_.clear_bit(GetGestureTypeIndex(gesture_type));
return false;
}
+bool TouchDispositionGestureFilter::GestureHandlingState::
+ HasFilteredGestureType(EventType gesture_type) const {
+ return any_gesture_of_type_dropped_.has_bit(
+ GetGestureTypeIndex(gesture_type));
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698