Home | History | Annotate | Download | only in gestures
      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/base/gestures/gesture_configuration.h"
      6 
      7 namespace ui {
      8 
      9 int GestureConfiguration::default_radius_ = 15;
     10 int GestureConfiguration::fling_max_cancel_to_down_time_in_ms_ = 400;
     11 int GestureConfiguration::fling_max_tap_gap_time_in_ms_ = 200;
     12 float GestureConfiguration::fling_velocity_cap_ = 17000.0f;
     13 int GestureConfiguration::tab_scrub_activation_delay_in_ms_ = 200;
     14 double GestureConfiguration::long_press_time_in_seconds_ = 1.0;
     15 double GestureConfiguration::semi_long_press_time_in_seconds_ = 0.4;
     16 double GestureConfiguration::max_distance_for_two_finger_tap_in_pixels_ = 300;
     17 int GestureConfiguration::max_radius_ = 100;
     18 double GestureConfiguration::max_seconds_between_double_click_ = 0.7;
     19 double
     20   GestureConfiguration::max_separation_for_gesture_touches_in_pixels_ = 150;
     21 double GestureConfiguration::max_swipe_deviation_ratio_ = 3;
     22 double
     23   GestureConfiguration::max_touch_down_duration_in_seconds_for_click_ = 0.8;
     24 double GestureConfiguration::max_touch_move_in_pixels_for_click_ = 10;
     25 double GestureConfiguration::max_distance_between_taps_for_double_tap_ = 20;
     26 double GestureConfiguration::min_distance_for_pinch_scroll_in_pixels_ = 20;
     27 double GestureConfiguration::min_flick_speed_squared_ = 550.f * 550.f;
     28 double GestureConfiguration::min_pinch_update_distance_in_pixels_ = 5;
     29 double GestureConfiguration::min_rail_break_velocity_ = 200;
     30 double GestureConfiguration::min_scroll_delta_squared_ = 4 * 4;
     31 int GestureConfiguration::min_scroll_successive_velocity_events_ = 3;
     32 float GestureConfiguration::min_scroll_velocity_ = 30.0f;
     33 double GestureConfiguration::min_swipe_speed_ = 20;
     34 double GestureConfiguration::scroll_prediction_seconds_ = 0.03;
     35 double
     36   GestureConfiguration::min_touch_down_duration_in_seconds_for_click_ = 0.01;
     37 
     38 // The number of points used in the linear regression which determines
     39 // touch velocity. Velocity is reported for 2 or more touch move events.
     40 int GestureConfiguration::points_buffered_for_velocity_ = 8;
     41 double GestureConfiguration::rail_break_proportion_ = 15;
     42 double GestureConfiguration::rail_start_proportion_ = 2;
     43 
     44 // Coefficients for a function that computes fling acceleration.
     45 // These are empirically determined defaults. Do not adjust without
     46 // additional empirical validation.
     47 float GestureConfiguration::fling_acceleration_curve_coefficients_[
     48     NumAccelParams] = {
     49   0.0166667f,
     50   -0.0238095f,
     51   0.0452381f,
     52   0.8f
     53 };
     54 
     55 }  // namespace ui
     56