OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // MSVC++ requires this to be set before any other includes to get M_PI. | 5 // MSVC++ requires this to be set before any other includes to get M_PI. |
6 #define _USE_MATH_DEFINES | 6 #define _USE_MATH_DEFINES |
7 | 7 |
8 #include "ui/events/gesture_detection/gesture_detector.h" | 8 #include "ui/events/gesture_detection/gesture_detector.h" |
9 | 9 |
10 #include <cmath> | 10 #include <cmath> |
(...skipping 20 matching lines...) Expand all Loading... |
31 enum TimeoutEvent { | 31 enum TimeoutEvent { |
32 SHOW_PRESS = 0, | 32 SHOW_PRESS = 0, |
33 LONG_PRESS, | 33 LONG_PRESS, |
34 TAP, | 34 TAP, |
35 TIMEOUT_EVENT_COUNT | 35 TIMEOUT_EVENT_COUNT |
36 }; | 36 }; |
37 | 37 |
38 } // namespace | 38 } // namespace |
39 | 39 |
40 // Note: These constants were taken directly from the default (unscaled) | 40 // Note: These constants were taken directly from the default (unscaled) |
41 // versions found in Android's ViewConfiguration. | 41 // versions found in Android's ViewConfiguration. Do not change these default |
| 42 // values without explicitly consulting an OWNER. |
42 GestureDetector::Config::Config() | 43 GestureDetector::Config::Config() |
43 : longpress_timeout(base::TimeDelta::FromMilliseconds(500)), | 44 : longpress_timeout(base::TimeDelta::FromMilliseconds(500)), |
44 showpress_timeout(base::TimeDelta::FromMilliseconds(180)), | 45 showpress_timeout(base::TimeDelta::FromMilliseconds(180)), |
45 double_tap_timeout(base::TimeDelta::FromMilliseconds(300)), | 46 double_tap_timeout(base::TimeDelta::FromMilliseconds(300)), |
46 double_tap_min_time(base::TimeDelta::FromMilliseconds(40)), | 47 double_tap_min_time(base::TimeDelta::FromMilliseconds(40)), |
47 touch_slop(8), | 48 touch_slop(8), |
48 double_tap_slop(100), | 49 double_tap_slop(100), |
49 minimum_fling_velocity(50), | 50 minimum_fling_velocity(50), |
50 maximum_fling_velocity(8000), | 51 maximum_fling_velocity(8000), |
51 swipe_enabled(false), | 52 swipe_enabled(false), |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 return false; | 492 return false; |
492 | 493 |
493 if (vx_abs > vy_abs) | 494 if (vx_abs > vy_abs) |
494 vy = 0; | 495 vy = 0; |
495 else | 496 else |
496 vx = 0; | 497 vx = 0; |
497 return listener_->OnSwipe(*current_down_event_, up, vx, vy); | 498 return listener_->OnSwipe(*current_down_event_, up, vx, vy); |
498 } | 499 } |
499 | 500 |
500 } // namespace ui | 501 } // namespace ui |
OLD | NEW |