OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "ui/events/gesture_detection/gesture_configuration.h" |
| 6 |
| 7 namespace ui { |
| 8 namespace { |
| 9 |
| 10 GestureConfiguration* instance = nullptr; |
| 11 |
| 12 } // namespace |
| 13 |
| 14 // static |
| 15 void GestureConfiguration::SetInstance(GestureConfiguration* config) { |
| 16 instance = config; |
| 17 } |
| 18 |
| 19 // static |
| 20 GestureConfiguration* GestureConfiguration::GetInstance() { |
| 21 if (instance) |
| 22 return instance; |
| 23 |
| 24 return GestureConfiguration::GetPlatformSpecificInstance(); |
| 25 } |
| 26 |
| 27 GestureConfiguration::GestureConfiguration() |
| 28 : default_radius_(25), |
| 29 double_tap_enabled_(false), |
| 30 double_tap_timeout_in_ms_(400), |
| 31 fling_max_cancel_to_down_time_in_ms_(400), |
| 32 fling_max_tap_gap_time_in_ms_(200), |
| 33 gesture_begin_end_types_enabled_(false), |
| 34 long_press_time_in_ms_(1000), |
| 35 max_distance_between_taps_for_double_tap_(20), |
| 36 max_distance_for_two_finger_tap_in_pixels_(300), |
| 37 max_fling_velocity_(17000.0f), |
| 38 max_gesture_bounds_length_(0), |
| 39 max_separation_for_gesture_touches_in_pixels_(150), |
| 40 max_swipe_deviation_angle_(20), |
| 41 max_time_between_double_click_in_ms_(700), |
| 42 max_touch_down_duration_for_click_in_ms_(800), |
| 43 max_touch_move_in_pixels_for_click_(15), |
| 44 min_distance_for_pinch_scroll_in_pixels_(20), |
| 45 min_fling_velocity_(30.0f), |
| 46 min_gesture_bounds_length_(0), |
| 47 min_pinch_update_span_delta_(0), |
| 48 // If this is too small, we currently can get single finger pinch zoom. |
| 49 // See crbug.com/357237 for details. |
| 50 min_scaling_span_in_pixels_(125), |
| 51 // The default value of min_scaling_touch_major_ is 2 * default_radius_. |
| 52 min_scaling_touch_major_(50), |
| 53 min_swipe_velocity_(20), |
| 54 // TODO(jdduke): Disable and remove entirely when issues with intermittent |
| 55 // scroll end detection on the Pixel are resolved, crbug.com/353702. |
| 56 #if defined(OS_CHROMEOS) |
| 57 scroll_debounce_interval_in_ms_(30), |
| 58 #else |
| 59 scroll_debounce_interval_in_ms_(0), |
| 60 #endif |
| 61 semi_long_press_time_in_ms_(400), |
| 62 show_press_delay_in_ms_(150), |
| 63 // The default value of span_slop_ is |
| 64 // 2 * max_touch_move_in_pixels_for_click_. |
| 65 span_slop_(30), |
| 66 swipe_enabled_(false), |
| 67 tab_scrub_activation_delay_in_ms_(200), |
| 68 two_finger_tap_enabled_(false), |
| 69 velocity_tracker_strategy_(VelocityTracker::Strategy::STRATEGY_DEFAULT) { |
| 70 } |
| 71 |
| 72 GestureConfiguration::~GestureConfiguration() { |
| 73 } |
| 74 |
| 75 } // namespace ui |
OLD | NEW |