Index: ui/events/gesture_detection/gesture_provider.cc |
diff --git a/ui/events/gesture_detection/gesture_provider.cc b/ui/events/gesture_detection/gesture_provider.cc |
index 55bc37010402aad0021a62760f0a07d5d378ca89..647e71af9d691612de13708d9ed35988d95a4d64 100644 |
--- a/ui/events/gesture_detection/gesture_provider.cc |
+++ b/ui/events/gesture_detection/gesture_provider.cc |
@@ -358,8 +358,14 @@ class GestureProvider::GestureListenerImpl |
if (distance_x || distance_y) { |
GestureEventDetails scroll_details( |
ET_GESTURE_SCROLL_UPDATE, -distance_x, -distance_y); |
- provider_->Send( |
- CreateGesture(ET_GESTURE_SCROLL_UPDATE, e2, scroll_details)); |
+ provider_->Send(CreateGesture(ET_GESTURE_SCROLL_UPDATE, |
jdduke (slow)
2014/05/28 16:26:00
Please cache GetBoundingBox(e2) before using.
tdresser
2014/05/29 14:26:21
Done.
|
+ e2.GetId(), |
+ e2.GetEventTime(), |
+ GetBoundingBox(e2).CenterPoint().x(), |
jdduke (slow)
2014/05/28 16:26:00
Just curious, why was this change necessary? Does
tdresser
2014/05/29 14:26:21
Multi-finger window dragging uses the scroll updat
jdduke (slow)
2014/05/29 16:25:40
sgtm.
|
+ GetBoundingBox(e2).CenterPoint().y(), |
+ e2.GetPointerCount(), |
+ GetBoundingBox(e2), |
+ scroll_details)); |
} |
return true; |
@@ -650,7 +656,6 @@ void GestureProvider::Fling(const MotionEvent& event, |
} |
void GestureProvider::Send(const GestureEventData& gesture) { |
- DCHECK(!gesture.time.is_null()); |
jdduke (slow)
2014/05/28 16:26:00
Why was this removed?
tdresser
2014/05/29 14:26:21
There are a whole pile of tests which synthesize g
jdduke (slow)
2014/05/29 16:25:40
My only worry here is that gesture detection is *v
tdresser
2014/05/30 14:05:37
Done.
|
// The only valid events that should be sent without an active touch sequence |
// are SHOW_PRESS and TAP, potentially triggered by the double-tap |
// delay timing out. |
@@ -741,8 +746,15 @@ void GestureProvider::OnTouchEventHandlingBegin(const MotionEvent& event) { |
Send(CreateGesture(ET_GESTURE_BEGIN, event)); |
break; |
case MotionEvent::ACTION_POINTER_DOWN: |
- if (gesture_begin_end_types_enabled_) |
- Send(CreateGesture(ET_GESTURE_BEGIN, event)); |
+ if (gesture_begin_end_types_enabled_) { |
+ Send(CreateGesture(ET_GESTURE_BEGIN, |
+ event.GetId(), |
+ event.GetEventTime(), |
+ event.GetX(event.GetActionIndex()), |
+ event.GetY(event.GetActionIndex()), |
+ event.GetPointerCount(), |
+ GetBoundingBox(event))); |
+ } |
break; |
case MotionEvent::ACTION_POINTER_UP: |
case MotionEvent::ACTION_UP: |
@@ -760,8 +772,17 @@ void GestureProvider::OnTouchEventHandlingEnd(const MotionEvent& event) { |
// |Fling()| will have already signalled an end to touch-scrolling. |
EndTouchScrollIfNecessary(event, true); |
- if (gesture_begin_end_types_enabled_) |
- Send(CreateGesture(ET_GESTURE_END, event)); |
+ if (gesture_begin_end_types_enabled_) { |
+ for (size_t i = 0; i < event.GetPointerCount(); ++i) { |
+ Send(CreateGesture(ET_GESTURE_END, |
+ event.GetId(), |
+ event.GetEventTime(), |
+ event.GetX(i), |
+ event.GetY(i), |
+ event.GetPointerCount() - i, |
+ GetBoundingBox(event))); |
jdduke (slow)
2014/05/28 16:26:00
Cache GetBoundingBox?
tdresser
2014/05/29 14:26:21
Done.
|
+ } |
+ } |
current_down_event_.reset(); |