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

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

Issue 10533029: Fix TAP_DOWN gesture event: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed build Created 8 years, 6 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_sequence.h ('k') | ui/views/view_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/gestures/gesture_sequence.cc
diff --git a/ui/base/gestures/gesture_sequence.cc b/ui/base/gestures/gesture_sequence.cc
index f11d5d1487ea0621b3ca47dc30a6e7b825f26b63..7e3302c21fb34b7f17829bcc1ce211b7f2fd1140 100644
--- a/ui/base/gestures/gesture_sequence.cc
+++ b/ui/base/gestures/gesture_sequence.cc
@@ -248,6 +248,11 @@ GestureSequence::Gestures* GestureSequence::ProcessTouchEventForGesture(
const int point_id = points_[event.GetTouchId()].point_id();
if (point_id < 0)
return NULL;
+
+ // Send GESTURE_BEGIN for any touch pressed.
+ if (event.GetEventType() == ui::ET_TOUCH_PRESSED)
+ AppendBeginGestureEvent(point, gestures.get());
+
switch (Signature(state_, point_id, event.GetEventType(), false)) {
case GST_NO_GESTURE_FIRST_PRESSED:
TouchDown(event, point, gestures.get());
@@ -351,7 +356,6 @@ GestureSequence::Gestures* GestureSequence::ProcessTouchEventForGesture(
case GST_PINCH_THIRD_PRESSED:
case GST_PINCH_FOURTH_PRESSED:
case GST_PINCH_FIFTH_PRESSED:
- AppendTapDownGestureEvent(point, gestures.get());
pinch_distance_current_ = BoundingBoxDiagonal(bounding_box_);
pinch_distance_start_ = pinch_distance_current_;
break;
@@ -359,7 +363,7 @@ GestureSequence::Gestures* GestureSequence::ProcessTouchEventForGesture(
if (event.GetEventType() == ui::ET_TOUCH_RELEASED ||
event.GetEventType() == ui::ET_TOUCH_CANCELLED)
- AppendTapUpGestureEvent(point, gestures.get());
+ AppendEndGestureEvent(point, gestures.get());
if (state_ != last_state)
DVLOG(4) << "Gesture Sequence"
@@ -476,13 +480,23 @@ void GestureSequence::AppendTapDownGestureEvent(const GesturePoint& point,
point.first_touch_position(),
flags_,
base::Time::FromDoubleT(point.last_touch_time()),
+ 0, 0.f, 1 << point.touch_id()));
+}
+
+void GestureSequence::AppendBeginGestureEvent(const GesturePoint& point,
+ Gestures* gestures) {
+ gestures->push_back(helper_->CreateGestureEvent(
+ ui::ET_GESTURE_BEGIN,
+ point.first_touch_position(),
+ flags_,
+ base::Time::FromDoubleT(point.last_touch_time()),
point_count_, 0.f, 1 << point.touch_id()));
}
-void GestureSequence::AppendTapUpGestureEvent(const GesturePoint& point,
+void GestureSequence::AppendEndGestureEvent(const GesturePoint& point,
Gestures* gestures) {
gestures->push_back(helper_->CreateGestureEvent(
- ui::ET_GESTURE_TAP_UP,
+ ui::ET_GESTURE_END,
point.first_touch_position(),
flags_,
base::Time::FromDoubleT(point.last_touch_time()),
« no previous file with comments | « ui/base/gestures/gesture_sequence.h ('k') | ui/views/view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698