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

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

Issue 10824158: Pass tap count (1 or 2) with tap gesture events (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with trunk 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_sequence.h ('k') | ui/base/gestures/gesture_types.h » ('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 1cf4cba9d66523eb8051ad23ce5bd6184410dfed..42c19b356633cec8514d0eb600bcce024c014b5a 100644
--- a/ui/base/gestures/gesture_sequence.cc
+++ b/ui/base/gestures/gesture_sequence.cc
@@ -596,11 +596,12 @@ void GestureSequence::AppendEndGestureEvent(const GesturePoint& point,
}
void GestureSequence::AppendClickGestureEvent(const GesturePoint& point,
+ int tap_count,
Gestures* gestures) {
gfx::Rect er = point.enclosing_rectangle();
gfx::Point center = er.CenterPoint();
gestures->push_back(CreateGestureEvent(
- GestureEventDetails(ui::ET_GESTURE_TAP, 0, 0),
+ GestureEventDetails(ui::ET_GESTURE_TAP, tap_count, 0),
center,
flags_,
base::Time::FromDoubleT(point.last_touch_time()),
@@ -753,8 +754,9 @@ bool GestureSequence::Click(const TouchEvent& event,
const GesturePoint& point, Gestures* gestures) {
DCHECK(state_ == GS_PENDING_SYNTHETIC_CLICK);
if (point.IsInClickWindow(event)) {
- AppendClickGestureEvent(point, gestures);
- if (point.IsInDoubleClickWindow(event))
+ bool double_tap = point.IsInDoubleClickWindow(event);
+ AppendClickGestureEvent(point, double_tap ? 2 : 1, gestures);
+ if (double_tap)
AppendDoubleClickGestureEvent(point, gestures);
return true;
}
« no previous file with comments | « ui/base/gestures/gesture_sequence.h ('k') | ui/base/gestures/gesture_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698