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

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

Issue 306483003: Prepare for Unified Gesture Recognizer landing in Aura (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Disable UGR again. Created 6 years, 7 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/gesture_detection/gesture_provider.cc
diff --git a/ui/events/gesture_detection/gesture_provider.cc b/ui/events/gesture_detection/gesture_provider.cc
index 8b9000ddad1e27d906fb1759a3a392c85ab0e372..ad7436b0d3f75c3025d2644506019e67eb9cbdf2 100644
--- a/ui/events/gesture_detection/gesture_provider.cc
+++ b/ui/events/gesture_detection/gesture_provider.cc
@@ -356,10 +356,17 @@ class GestureProvider::GestureListenerImpl
}
if (distance_x || distance_y) {
+ const gfx::RectF& bounding_box = GetBoundingBox(e2);
jdduke (slow) 2014/05/29 16:25:40 Wait, why are capturing a variable returned by val
tdresser 2014/05/30 14:05:37 Done.
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,
+ e2.GetId(),
+ e2.GetEventTime(),
+ bounding_box.CenterPoint().x(),
+ bounding_box.CenterPoint().y(),
+ e2.GetPointerCount(),
+ bounding_box,
+ scroll_details));
}
return true;
@@ -648,7 +655,6 @@ void GestureProvider::Fling(const MotionEvent& event,
}
void GestureProvider::Send(const GestureEventData& gesture) {
- DCHECK(!gesture.time.is_null());
// 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.
@@ -739,8 +745,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:
@@ -753,18 +766,30 @@ void GestureProvider::OnTouchEventHandlingBegin(const MotionEvent& event) {
void GestureProvider::OnTouchEventHandlingEnd(const MotionEvent& event) {
switch (event.GetAction()) {
case MotionEvent::ACTION_UP:
- case MotionEvent::ACTION_CANCEL:
+ case MotionEvent::ACTION_CANCEL: {
// Note: This call will have no effect if a fling was just generated, as
// |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));
+ const gfx::RectF& bounding_box = GetBoundingBox(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,
+ bounding_box));
+ }
+ }
current_down_event_.reset();
UpdateDoubleTapDetectionSupport();
break;
+ }
case MotionEvent::ACTION_POINTER_UP:
if (gesture_begin_end_types_enabled_)
Send(CreateGesture(ET_GESTURE_END, event));

Powered by Google App Engine
This is Rietveld 408576698