OLD | NEW |
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/events/gestures/gesture_sequence.h" | 5 #include "ui/events/gestures/gesture_sequence.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <limits> | 9 #include <limits> |
10 | 10 |
(...skipping 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1081 flags_, | 1081 flags_, |
1082 base::Time::FromDoubleT(point.last_touch_time()), | 1082 base::Time::FromDoubleT(point.last_touch_time()), |
1083 ComputeTouchBitmask(points_))); | 1083 ComputeTouchBitmask(points_))); |
1084 } | 1084 } |
1085 | 1085 |
1086 void GestureSequence::AppendSwipeGesture(const GesturePoint& point, | 1086 void GestureSequence::AppendSwipeGesture(const GesturePoint& point, |
1087 int swipe_x, | 1087 int swipe_x, |
1088 int swipe_y, | 1088 int swipe_y, |
1089 Gestures* gestures) { | 1089 Gestures* gestures) { |
1090 gestures->push_back(CreateGestureEvent( | 1090 gestures->push_back(CreateGestureEvent( |
1091 GestureEventDetails(ui::ET_GESTURE_MULTIFINGER_SWIPE, swipe_x, swipe_y), | 1091 GestureEventDetails(ui::ET_GESTURE_SWIPE, swipe_x, swipe_y), |
1092 bounding_box_.CenterPoint(), | 1092 bounding_box_.CenterPoint(), |
1093 flags_, | 1093 flags_, |
1094 base::Time::FromDoubleT(point.last_touch_time()), | 1094 base::Time::FromDoubleT(point.last_touch_time()), |
1095 ComputeTouchBitmask(points_))); | 1095 ComputeTouchBitmask(points_))); |
1096 } | 1096 } |
1097 | 1097 |
1098 void GestureSequence::AppendTwoFingerTapGestureEvent(Gestures* gestures) { | 1098 void GestureSequence::AppendTwoFingerTapGestureEvent(Gestures* gestures) { |
1099 const GesturePoint* point = GetPointByPointId(0); | 1099 const GesturePoint* point = GetPointByPointId(0); |
1100 const gfx::RectF& rect = point->enclosing_rectangle(); | 1100 const gfx::RectF& rect = point->enclosing_rectangle(); |
1101 gestures->push_back(CreateGestureEvent( | 1101 gestures->push_back(CreateGestureEvent( |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1458 } | 1458 } |
1459 | 1459 |
1460 void GestureSequence::StartRailFreeScroll(const GesturePoint& point, | 1460 void GestureSequence::StartRailFreeScroll(const GesturePoint& point, |
1461 Gestures* gestures) { | 1461 Gestures* gestures) { |
1462 AppendScrollGestureBegin(point, point.first_touch_position(), gestures); | 1462 AppendScrollGestureBegin(point, point.first_touch_position(), gestures); |
1463 scroll_type_ = ST_FREE; | 1463 scroll_type_ = ST_FREE; |
1464 set_state(GS_SCROLL); | 1464 set_state(GS_SCROLL); |
1465 } | 1465 } |
1466 | 1466 |
1467 } // namespace ui | 1467 } // namespace ui |
OLD | NEW |