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

Unified Diff: ui/base/gestures/gesture_types.cc

Issue 10837329: gesture: Include velocity in scroll-update gestures. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 4 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/base/gestures/gesture_types.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/gestures/gesture_types.cc
diff --git a/ui/base/gestures/gesture_types.cc b/ui/base/gestures/gesture_types.cc
index 55dc7a17bbafe89efff7460b39dce857674661ac..ba659c5c23fa92bb01b5de31bac56cb236fdd92f 100644
--- a/ui/base/gestures/gesture_types.cc
+++ b/ui/base/gestures/gesture_types.cc
@@ -13,13 +13,13 @@ GestureEventDetails::GestureEventDetails(ui::EventType type,
touch_points_(1) {
switch (type_) {
case ui::ET_GESTURE_SCROLL_UPDATE:
- data.scroll.x = delta_x;
- data.scroll.y = delta_y;
+ data.scroll_update.x = delta_x;
+ data.scroll_update.y = delta_y;
break;
case ui::ET_SCROLL_FLING_START:
- data.velocity.x = delta_x;
- data.velocity.y = delta_y;
+ data.fling_velocity.x = delta_x;
+ data.fling_velocity.y = delta_y;
break;
case ui::ET_GESTURE_LONG_PRESS:
@@ -45,8 +45,6 @@ GestureEventDetails::GestureEventDetails(ui::EventType type,
break;
default:
- data.generic.delta_x = delta_x;
- data.generic.delta_y = delta_y;
if (delta_x != 0.f || delta_y != 0.f) {
DLOG(WARNING) << "A gesture event (" << type << ") had unknown data: ("
<< delta_x << "," << delta_y;
@@ -55,4 +53,11 @@ GestureEventDetails::GestureEventDetails(ui::EventType type,
}
}
+void GestureEventDetails::SetScrollVelocity(float velocity_x,
+ float velocity_y) {
+ CHECK_EQ(ui::ET_GESTURE_SCROLL_UPDATE, type_);
+ data.scroll_update.velocity_x = velocity_x;
+ data.scroll_update.velocity_y = velocity_y;
+}
+
} // namespace ui
« no previous file with comments | « ui/base/gestures/gesture_types.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698