OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "ui/events/gesture_detection/gesture_configuration.h" | |
6 | |
7 namespace ui { | |
8 | |
9 GestureConfiguration::GestureConfiguration() | |
10 : default_radius_(25), | |
11 fling_max_cancel_to_down_time_in_ms_(400), | |
12 fling_max_tap_gap_time_in_ms_(200), | |
13 gesture_begin_end_types_enabled_(false), | |
14 max_distance_for_two_finger_tap_in_pixels_(300), | |
15 max_gesture_bounds_length_(0), | |
16 max_separation_for_gesture_touches_in_pixels_(150), | |
17 max_swipe_deviation_angle_(20), | |
18 max_time_between_double_click_in_ms_(700), | |
19 max_touch_down_duration_for_click_in_ms_(800), | |
20 min_distance_for_pinch_scroll_in_pixels_(20), | |
21 min_gesture_bounds_length_(0), | |
jdduke (slow)
2014/10/22 17:31:34
It looks like we're missing a number of initialize
lanwei
2014/10/23 01:26:17
Done.
| |
22 min_pinch_update_distance_in_pixels_(5), | |
jdduke (slow)
2014/10/22 17:31:33
min_pinch_update_distance_in_pixels_ should defaul
lanwei
2014/10/23 01:26:17
Done.
| |
23 min_swipe_speed_(20), | |
24 // TODO(jdduke): Disable and remove entirely when issues with intermittent | |
25 // scroll end detection on the Pixel are resolved, crbug.com/353702. | |
26 #if defined(OS_CHROMEOS) | |
27 scroll_debounce_interval_in_ms_(30), | |
28 #else | |
29 scroll_debounce_interval_in_ms_(0), | |
30 #endif | |
31 swipe_enabled_(false), | |
32 tab_scrub_activation_delay_in_ms_(200), | |
33 two_finger_tap_enabled_(false) { | |
34 } | |
35 | |
36 GestureConfiguration::~GestureConfiguration() { | |
37 } | |
38 | |
39 GestureProvider::Config GestureConfiguration::DefaultGestureProviderConfig() { | |
40 GestureProvider::Config config; | |
41 config.display = display(); | |
42 config.gesture_detector_config = DefaultGestureDetectorConfig(); | |
43 config.scale_gesture_detector_config = DefaultScaleGestureDetectorConfig(); | |
44 config.gesture_begin_end_types_enabled = gesture_begin_end_types_enabled(); | |
45 config.min_gesture_bounds_length = min_gesture_bounds_length(); | |
46 config.max_gesture_bounds_length = max_gesture_bounds_length(); | |
47 return config; | |
48 } | |
49 | |
50 GestureDetector::Config GestureConfiguration::DefaultGestureDetectorConfig() { | |
51 GestureDetector::Config config; | |
52 config.longpress_timeout = | |
53 base::TimeDelta::FromMilliseconds(long_press_time_in_ms()); | |
54 config.showpress_timeout = | |
55 base::TimeDelta::FromMilliseconds(show_press_delay_in_ms()); | |
56 config.double_tap_timeout = | |
57 base::TimeDelta::FromMilliseconds(semi_long_press_time_in_ms()); | |
58 config.touch_slop = max_touch_move_in_pixels_for_click(); | |
59 config.double_tap_slop = max_distance_between_taps_for_double_tap(); | |
60 config.minimum_fling_velocity = min_scroll_velocity(); | |
jdduke (slow)
2014/10/22 17:31:33
Can we rename min_scroll_velocity and fling_veloci
lanwei
2014/10/23 01:26:18
Done.
| |
61 config.maximum_fling_velocity = fling_velocity_cap(); | |
62 config.swipe_enabled = swipe_enabled(); | |
63 config.minimum_swipe_velocity = min_swipe_speed(); | |
jdduke (slow)
2014/10/22 17:31:34
We use velocity elsewhere, can we use it here too
lanwei
2014/10/23 01:26:18
Done.
| |
64 config.maximum_swipe_deviation_angle = max_swipe_deviation_angle(); | |
65 config.two_finger_tap_enabled = two_finger_tap_enabled(); | |
66 config.two_finger_tap_max_separation = | |
67 max_distance_for_two_finger_tap_in_pixels(); | |
68 config.two_finger_tap_timeout = base::TimeDelta::FromMilliseconds( | |
69 max_touch_down_duration_for_click_in_ms()); | |
70 return config; | |
71 } | |
72 | |
73 ScaleGestureDetector::Config | |
74 GestureConfiguration::DefaultScaleGestureDetectorConfig() { | |
75 ScaleGestureDetector::Config config; | |
76 config.span_slop = span_slop(); | |
77 config.min_scaling_touch_major = min_scaling_touch_major(); | |
78 config.min_scaling_span = min_scaling_span_in_pixels(); | |
79 config.min_pinch_update_span_delta = min_pinch_update_span_delta(); | |
80 return config; | |
81 } | |
82 | |
83 } // namespace ui | |
OLD | NEW |