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

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

Issue 510793003: Remove ui::TouchEvent -> blink::WebTouchEvent conversion methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address jdduke's comments. Created 5 years, 11 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
Index: ui/events/gestures/gesture_provider_aura.cc
diff --git a/ui/events/gestures/gesture_provider_aura.cc b/ui/events/gestures/gesture_provider_aura.cc
index 97d875c0f065e9909bd560738df1d46c2b4636d1..f053f9b14ace92285009eb03c7d8d5226ff03f6a 100644
--- a/ui/events/gestures/gesture_provider_aura.cc
+++ b/ui/events/gestures/gesture_provider_aura.cc
@@ -27,31 +27,11 @@ GestureProviderAura::GestureProviderAura(GestureProviderAuraClient* client)
GestureProviderAura::~GestureProviderAura() {}
bool GestureProviderAura::OnTouchEvent(TouchEvent* event) {
- DCHECK(event);
- last_unique_touch_event_id_ = event->unique_event_id();
- int index = pointer_state_.FindPointerIndexOfId(event->touch_id());
- bool pointer_id_is_active = index != -1;
-
- if (event->type() == ET_TOUCH_PRESSED && pointer_id_is_active) {
- // Ignore touch press events if we already believe the pointer is down.
- return false;
- } else if (event->type() != ET_TOUCH_PRESSED && !pointer_id_is_active) {
- // We could have an active touch stream transfered to us, resulting in touch
- // move or touch up events without associated touch down events. Ignore
- // them.
- return false;
- }
-
- // If this is a touchmove event, and it isn't different from the last
- // event, ignore it.
- if (event->type() == ET_TOUCH_MOVED &&
- event->x() == pointer_state_.GetX(index) &&
- event->y() == pointer_state_.GetY(index)) {
+ if (!pointer_state_.OnTouch(*event))
return false;
- }
+ last_unique_touch_event_id_ = event->unique_event_id();
last_touch_event_latency_info_ = *event->latency();
- pointer_state_.OnTouch(*event);
auto result = filtered_gesture_provider_.OnTouchEvent(pointer_state_);
if (!result.succeeded)

Powered by Google App Engine
This is Rietveld 408576698