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

Side by Side Diff: ui/events/gesture_detection/gesture_detector.cc

Issue 718153002: Indicate whether a touch event will cause scrolling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
OLDNEW
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
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 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 return false; 494 return false;
494 495
495 if (vx_abs > vy_abs) 496 if (vx_abs > vy_abs)
496 vy = 0; 497 vy = 0;
497 else 498 else
498 vx = 0; 499 vx = 0;
499 return listener_->OnSwipe(*current_down_event_, up, vx, vy); 500 return listener_->OnSwipe(*current_down_event_, up, vx, vy);
500 } 501 }
501 502
502 } // namespace ui 503 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698