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

Unified Diff: ui/aura/gestures/gesture_sequence.cc

Issue 9773024: This patch implements Chromium's Aura gesture recognizer in terms of utouch-grail and utouch-frame … (Closed) Base URL: https://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 years, 8 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/aura/gestures/gesture_recognizer_unittest.cc ('k') | ui/aura/root_window.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/gestures/gesture_sequence.cc
===================================================================
--- ui/aura/gestures/gesture_sequence.cc (revision 126124)
+++ ui/aura/gestures/gesture_sequence.cc (working copy)
@@ -309,7 +309,7 @@
point.first_touch_position().y(),
flags_,
base::Time::FromDoubleT(point.last_touch_time()),
- 0.f, 0.f)));
+ GestureEvent::Properties())));
}
void GestureSequence::AppendClickGestureEvent(const GesturePoint& point,
@@ -320,7 +320,7 @@
point.first_touch_position().y(),
flags_,
base::Time::FromDoubleT(point.last_touch_time()),
- 0.f, 0.f)));
+ GestureEvent::Properties())));
}
void GestureSequence::AppendDoubleClickGestureEvent(const GesturePoint& point,
@@ -331,7 +331,7 @@
point.first_touch_position().y(),
flags_,
base::Time::FromDoubleT(point.last_touch_time()),
- 0.f, 0.f)));
+ GestureEvent::Properties())));
}
void GestureSequence::AppendScrollGestureBegin(const GesturePoint& point,
@@ -343,7 +343,7 @@
location.y(),
flags_,
base::Time::FromDoubleT(point.last_touch_time()),
- 0.f, 0.f)));
+ GestureEvent::Properties())));
}
void GestureSequence::AppendScrollGestureEnd(const GesturePoint& point,
@@ -359,13 +359,17 @@
else if (scroll_type_ == ST_VERTICAL)
railed_x_velocity = 0;
+ GestureEvent::Properties props;
+ props.delta_x = railed_x_velocity;
+ props.delta_y = railed_y_velocity;
+
gestures->push_back(linked_ptr<GestureEvent>(new GestureEvent(
ui::ET_GESTURE_SCROLL_END,
location.x(),
location.y(),
flags_,
base::Time::FromDoubleT(point.last_touch_time()),
- railed_x_velocity, railed_y_velocity)));
+ props)));
}
void GestureSequence::AppendScrollGestureUpdate(const GesturePoint& point,
@@ -379,13 +383,17 @@
else if (scroll_type_ == ST_VERTICAL)
dx = 0;
+ GestureEvent::Properties props;
+ props.delta_x = dx;
+ props.delta_y = dy;
+
gestures->push_back(linked_ptr<GestureEvent>(new GestureEvent(
ui::ET_GESTURE_SCROLL_UPDATE,
location.x(),
location.y(),
flags_,
base::Time::FromDoubleT(point.last_touch_time()),
- dx, dy)));
+ props)));
}
void GestureSequence::AppendPinchGestureBegin(const GesturePoint& p1,
@@ -398,7 +406,7 @@
center.y(),
flags_,
base::Time::FromDoubleT(p1.last_touch_time()),
- 0.f, 0.f)));
+ GestureEvent::Properties())));
}
void GestureSequence::AppendPinchGestureEnd(const GesturePoint& p1,
@@ -406,13 +414,17 @@
float scale,
Gestures* gestures) {
gfx::Point center = p1.last_touch_position().Middle(p2.last_touch_position());
+ GestureEvent::Properties props;
+ props.delta_x = scale;
+ props.scale_x = scale;
+
gestures->push_back(linked_ptr<GestureEvent>(new GestureEvent(
ui::ET_GESTURE_PINCH_END,
center.x(),
center.y(),
flags_,
base::Time::FromDoubleT(p1.last_touch_time()),
- scale, 0.f)));
+ props)));
}
void GestureSequence::AppendPinchGestureUpdate(const GesturePoint& p1,
@@ -422,13 +434,18 @@
// TODO(sad): Compute rotation and include it in delta_y.
// http://crbug.com/113145
gfx::Point center = p1.last_touch_position().Middle(p2.last_touch_position());
+
+ GestureEvent::Properties props;
+ props.delta_x = scale;
+ props.scale_x = scale;
+
gestures->push_back(linked_ptr<GestureEvent>(new GestureEvent(
ui::ET_GESTURE_PINCH_UPDATE,
center.x(),
center.y(),
flags_,
base::Time::FromDoubleT(p1.last_touch_time()),
- scale, 0.f)));
+ props)));
}
bool GestureSequence::Click(const TouchEvent& event,
@@ -500,13 +517,16 @@
void GestureSequence::AppendLongPressGestureEvent() {
const GesturePoint* point = GetPointByPointId(0);
+ GestureEvent::Properties props;
+ props.point_id = point->point_id();
+
GestureEvent gesture(
ui::ET_GESTURE_LONG_PRESS,
point->first_touch_position().x(),
point->first_touch_position().y(),
flags_,
base::Time::FromDoubleT(point->last_touch_time()),
- point->point_id(), 0.f);
+ props);
root_window_->DispatchGestureEvent(&gesture);
}
« no previous file with comments | « ui/aura/gestures/gesture_recognizer_unittest.cc ('k') | ui/aura/root_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698