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

Side by Side Diff: ui/base/gestures/gesture_sequence.cc

Issue 16018006: Generate tap gesture with tap_count = 3 for triple-tap (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fix sky's comment Created 7 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 unified diff | Download patch
« no previous file with comments | « ui/base/gestures/gesture_point.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/base/gestures/gesture_sequence.h" 5 #include "ui/base/gestures/gesture_sequence.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <stdlib.h> 8 #include <stdlib.h>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after
840 flags_, 840 flags_,
841 base::Time::FromDoubleT(point->last_touch_time()), 841 base::Time::FromDoubleT(point->last_touch_time()),
842 1 << point->touch_id())); 842 1 << point->touch_id()));
843 } 843 }
844 844
845 bool GestureSequence::Click(const TouchEvent& event, 845 bool GestureSequence::Click(const TouchEvent& event,
846 const GesturePoint& point, 846 const GesturePoint& point,
847 Gestures* gestures) { 847 Gestures* gestures) {
848 DCHECK(state_ == GS_PENDING_SYNTHETIC_CLICK); 848 DCHECK(state_ == GS_PENDING_SYNTHETIC_CLICK);
849 if (point.IsInClickWindow(event)) { 849 if (point.IsInClickWindow(event)) {
850 bool double_tap = point.IsInDoubleClickWindow(event); 850 int tap_count = 1;
851 AppendClickGestureEvent(point, double_tap ? 2 : 1, gestures); 851 if (point.IsInTripleClickWindow(event))
852 tap_count = 3;
853 else if (point.IsInDoubleClickWindow(event))
854 tap_count = 2;
855 AppendClickGestureEvent(point, tap_count, gestures);
852 return true; 856 return true;
853 } else if (point.IsInsideManhattanSquare(event) && 857 } else if (point.IsInsideManhattanSquare(event) &&
854 !GetLongPressTimer()->IsRunning()) { 858 !GetLongPressTimer()->IsRunning()) {
855 AppendLongTapGestureEvent(point, gestures); 859 AppendLongTapGestureEvent(point, gestures);
856 } 860 }
857 return false; 861 return false;
858 } 862 }
859 863
860 bool GestureSequence::ScrollStart(const TouchEvent& event, 864 bool GestureSequence::ScrollStart(const TouchEvent& event,
861 GesturePoint& point, 865 GesturePoint& point,
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
1137 return; 1141 return;
1138 1142
1139 // Since long press timer has been started, there should be a non-NULL point. 1143 // Since long press timer has been started, there should be a non-NULL point.
1140 const GesturePoint* point = GetPointByPointId(0); 1144 const GesturePoint* point = GetPointByPointId(0);
1141 if (!ui::gestures::IsInsideManhattanSquare(point->first_touch_position(), 1145 if (!ui::gestures::IsInsideManhattanSquare(point->first_touch_position(),
1142 event.location())) 1146 event.location()))
1143 GetLongPressTimer()->Stop(); 1147 GetLongPressTimer()->Stop();
1144 } 1148 }
1145 1149
1146 } // namespace ui 1150 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/gestures/gesture_point.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698