| Index: ui/events/gesture_event_details.h
|
| diff --git a/ui/events/gesture_event_details.h b/ui/events/gesture_event_details.h
|
| index 502df8abdf6d13a92033ee9f931eaca9a32f2cc7..f02b0722969f44a030d7535cb5f4c967e102d359 100644
|
| --- a/ui/events/gesture_event_details.h
|
| +++ b/ui/events/gesture_event_details.h
|
| @@ -15,8 +15,14 @@ namespace ui {
|
|
|
| struct EVENTS_BASE_EXPORT GestureEventDetails {
|
| public:
|
| + enum class ScrollRailState { Vertical, Horizontal, Free };
|
| +
|
| GestureEventDetails();
|
| explicit GestureEventDetails(EventType type);
|
| + GestureEventDetails(EventType type,
|
| + float delta_x,
|
| + float delta_y,
|
| + ScrollRailState scroll_rail_state);
|
| GestureEventDetails(EventType type, float delta_x, float delta_y);
|
|
|
| // The caller is responsible for ensuring that the gesture data from |other|
|
| @@ -70,12 +76,24 @@ struct EVENTS_BASE_EXPORT GestureEventDetails {
|
|
|
| float velocity_x() const {
|
| DCHECK_EQ(ET_SCROLL_FLING_START, type_);
|
| - return data_.fling_velocity.x;
|
| + return data_.fling_start.x;
|
| }
|
|
|
| float velocity_y() const {
|
| DCHECK_EQ(ET_SCROLL_FLING_START, type_);
|
| - return data_.fling_velocity.y;
|
| + return data_.fling_start.y;
|
| + }
|
| +
|
| + ScrollRailState scroll_rail_state() const {
|
| + switch(type_) {
|
| + case ET_GESTURE_SCROLL_UPDATE:
|
| + return data_.scroll_update.scroll_rail_state;
|
| + case ET_SCROLL_FLING_START:
|
| + return data_.fling_start.scroll_rail_state;
|
| + default:
|
| + NOTREACHED() << "Can't get scroll rail state for event type " << type_;
|
| + }
|
| + return ScrollRailState::Free;
|
| }
|
|
|
| float first_finger_width() const {
|
| @@ -161,6 +179,7 @@ struct EVENTS_BASE_EXPORT GestureEventDetails {
|
| // Whether any previous scroll update in the current scroll sequence was
|
| // suppressed because the underlying touch was consumed.
|
| bool previous_update_in_sequence_prevented;
|
| + ScrollRailState scroll_rail_state;
|
| } scroll_update;
|
|
|
| float scale; // PINCH scale.
|
| @@ -168,7 +187,8 @@ struct EVENTS_BASE_EXPORT GestureEventDetails {
|
| struct { // FLING velocity.
|
| float x;
|
| float y;
|
| - } fling_velocity;
|
| + ScrollRailState scroll_rail_state;
|
| + } fling_start;
|
|
|
| // Dimensions of the first finger's enclosing rectangle for
|
| // TWO_FINGER_TAP.
|
|
|