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 5cbe56fac43f21dc8c6ac9b3131ebe668447d874..4d1ed088815de057e9877b542fd3ebe2df9e5186 100644 |
--- a/ui/events/gesture_detection/gesture_provider.cc |
+++ b/ui/events/gesture_detection/gesture_provider.cc |
@@ -245,7 +245,8 @@ class GestureProvider::GestureListenerImpl |
: 1.0f - kDoubleTapDragZoomSpeed, |
std::abs(dy)); |
} |
- GestureEventDetails pinch_details(ET_GESTURE_PINCH_UPDATE, scale, 0); |
+ GestureEventDetails pinch_details(ET_GESTURE_PINCH_UPDATE); |
+ pinch_details.set_scale(scale); |
Send(CreateGesture(pinch_details, |
e.GetId(), |
e.GetToolType(), |
@@ -261,7 +262,7 @@ class GestureProvider::GestureListenerImpl |
// GestureDetector::GestureListener implementation. |
virtual bool OnDown(const MotionEvent& e) OVERRIDE { |
- GestureEventDetails tap_details(ET_GESTURE_TAP_DOWN, 0, 0); |
+ GestureEventDetails tap_details(ET_GESTURE_TAP_DOWN); |
Send(CreateGesture(tap_details, e)); |
// Return true to indicate that we want to handle touch. |
@@ -398,7 +399,7 @@ class GestureProvider::GestureListenerImpl |
} |
virtual void OnShowPress(const MotionEvent& e) OVERRIDE { |
- GestureEventDetails show_press_details(ET_GESTURE_SHOW_PRESS, 0, 0); |
+ GestureEventDetails show_press_details(ET_GESTURE_SHOW_PRESS); |
show_press_event_sent_ = true; |
Send(CreateGesture(show_press_details, e)); |
} |
@@ -428,7 +429,7 @@ class GestureProvider::GestureListenerImpl |
if (e.GetAction() == MotionEvent::ACTION_UP && |
!current_longpress_time_.is_null() && |
!IsScaleGestureDetectionInProgress()) { |
- GestureEventDetails long_tap_details(ET_GESTURE_LONG_TAP, 0, 0); |
+ GestureEventDetails long_tap_details(ET_GESTURE_LONG_TAP); |
Send(CreateGesture(long_tap_details, e)); |
return true; |
} |
@@ -477,7 +478,7 @@ class GestureProvider::GestureListenerImpl |
virtual void OnLongPress(const MotionEvent& e) OVERRIDE { |
DCHECK(!IsDoubleTapInProgress()); |
SetIgnoreSingleTap(true); |
- GestureEventDetails long_press_details(ET_GESTURE_LONG_PRESS, 0, 0); |
+ GestureEventDetails long_press_details(ET_GESTURE_LONG_PRESS); |
Send(CreateGesture(long_press_details, e)); |
} |
@@ -513,7 +514,7 @@ class GestureProvider::GestureListenerImpl |
float raw_y, |
size_t touch_point_count, |
const gfx::RectF& bounding_box) { |
- return GestureEventData(GestureEventDetails(type, 0, 0), |
+ return GestureEventData(GestureEventDetails(type), |
motion_event_id, |
primary_tool_type, |
time, |
@@ -540,14 +541,16 @@ class GestureProvider::GestureListenerImpl |
} |
GestureEventData CreateGesture(EventType type, const MotionEvent& event) { |
- return CreateGesture(GestureEventDetails(type, 0, 0), event); |
+ return CreateGesture(GestureEventDetails(type), event); |
} |
GestureEventData CreateTapGesture(EventType type, const MotionEvent& event) { |
// Set the tap count to 1 even for ET_GESTURE_DOUBLE_TAP, in order to be |
// consistent with double tap behavior on a mobile viewport. See |
// crbug.com/234986 for context. |
- return CreateGesture(GestureEventDetails(type, 1, 0), event); |
+ GestureEventDetails details(type); |
+ details.set_tap_count(1); |
+ return CreateGesture(details, event); |
} |
gfx::RectF GetBoundingBox(const MotionEvent& event, EventType type) { |