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 <algorithm> |
10 #include <cmath> | 11 #include <cmath> |
11 | 12 |
12 #include "base/timer/timer.h" | 13 #include "base/timer/timer.h" |
13 #include "ui/events/gesture_detection/gesture_listeners.h" | 14 #include "ui/events/gesture_detection/gesture_listeners.h" |
14 #include "ui/events/gesture_detection/motion_event.h" | 15 #include "ui/events/gesture_detection/motion_event.h" |
15 | 16 |
16 namespace ui { | 17 namespace ui { |
17 namespace { | 18 namespace { |
18 | 19 |
19 // Using a small epsilon when comparing slop distances allows pixel perfect | 20 // Using a small epsilon when comparing slop distances allows pixel perfect |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
528 return false; | 529 return false; |
529 | 530 |
530 if (vx_abs > vy_abs) | 531 if (vx_abs > vy_abs) |
531 vy = 0; | 532 vy = 0; |
532 else | 533 else |
533 vx = 0; | 534 vx = 0; |
534 return listener_->OnSwipe(*current_down_event_, up, vx, vy); | 535 return listener_->OnSwipe(*current_down_event_, up, vx, vy); |
535 } | 536 } |
536 | 537 |
537 } // namespace ui | 538 } // namespace ui |
OLD | NEW |