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

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: Fix whitespace, disable UGR. 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
« no previous file with comments | « ui/events/event_constants.h ('k') | ui/events/gesture_detection/gesture_provider_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..dbe4de4cdc83b50b7a48d4494d7722fe1c7a8df4 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);
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;
@@ -739,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:
@@ -753,18 +767,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));
« no previous file with comments | « ui/events/event_constants.h ('k') | ui/events/gesture_detection/gesture_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698