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

Unified Diff: ui/events/gesture_event_details.h

Issue 1049383003: Postpone rail application for touch scrolling - chrome side. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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_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.

Powered by Google App Engine
This is Rietveld 408576698