| 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 #include "ui/events/gesture_detection/gesture_configuration.h" | 5 #include "ui/events/gesture_detection/gesture_configuration.h" |
| 6 | 6 |
| 7 #include "base/android/build_info.h" | 7 #include "base/android/build_info.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
| 10 #include "ui/gfx/android/view_configuration.h" | 10 #include "ui/gfx/android/view_configuration.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 ViewConfiguration::GetMaximumFlingVelocityInDipsPerSecond()); | 50 ViewConfiguration::GetMaximumFlingVelocityInDipsPerSecond()); |
| 51 set_max_gesture_bounds_length(kMaxGestureBoundsLengthDips); | 51 set_max_gesture_bounds_length(kMaxGestureBoundsLengthDips); |
| 52 set_max_touch_move_in_pixels_for_click( | 52 set_max_touch_move_in_pixels_for_click( |
| 53 ViewConfiguration::GetTouchSlopInDips()); | 53 ViewConfiguration::GetTouchSlopInDips()); |
| 54 set_min_fling_velocity( | 54 set_min_fling_velocity( |
| 55 ViewConfiguration::GetMinimumFlingVelocityInDipsPerSecond()); | 55 ViewConfiguration::GetMinimumFlingVelocityInDipsPerSecond()); |
| 56 set_min_gesture_bounds_length(kMinGestureBoundsLengthDips); | 56 set_min_gesture_bounds_length(kMinGestureBoundsLengthDips); |
| 57 set_min_pinch_update_span_delta(0.f); | 57 set_min_pinch_update_span_delta(0.f); |
| 58 set_min_scaling_span_in_pixels( | 58 set_min_scaling_span_in_pixels( |
| 59 ViewConfiguration::GetMinScalingSpanInDips()); | 59 ViewConfiguration::GetMinScalingSpanInDips()); |
| 60 set_min_scaling_touch_major( | |
| 61 ViewConfiguration::GetMinScalingTouchMajorInDips()); | |
| 62 set_show_press_delay_in_ms(ViewConfiguration::GetTapTimeoutInMs()); | 60 set_show_press_delay_in_ms(ViewConfiguration::GetTapTimeoutInMs()); |
| 63 set_span_slop(ViewConfiguration::GetTouchSlopInDips() * 2.f); | 61 set_span_slop(ViewConfiguration::GetTouchSlopInDips() * 2.f); |
| 64 set_fling_touchscreen_tap_suppression_enabled(true); | 62 set_fling_touchscreen_tap_suppression_enabled(true); |
| 65 set_fling_touchpad_tap_suppression_enabled(false); | 63 set_fling_touchpad_tap_suppression_enabled(false); |
| 66 set_fling_max_cancel_to_down_time_in_ms( | 64 set_fling_max_cancel_to_down_time_in_ms( |
| 67 ViewConfiguration::GetTapTimeoutInMs()); | 65 ViewConfiguration::GetTapTimeoutInMs()); |
| 68 set_fling_max_tap_gap_time_in_ms( | 66 set_fling_max_tap_gap_time_in_ms( |
| 69 ViewConfiguration::GetLongPressTimeoutInMs()); | 67 ViewConfiguration::GetLongPressTimeoutInMs()); |
| 70 } | 68 } |
| 71 | 69 |
| 72 friend struct base::DefaultSingletonTraits<GestureConfigurationAndroid>; | 70 friend struct base::DefaultSingletonTraits<GestureConfigurationAndroid>; |
| 73 DISALLOW_COPY_AND_ASSIGN(GestureConfigurationAndroid); | 71 DISALLOW_COPY_AND_ASSIGN(GestureConfigurationAndroid); |
| 74 }; | 72 }; |
| 75 | 73 |
| 76 } // namespace | 74 } // namespace |
| 77 | 75 |
| 78 // Create a GestureConfigurationAura singleton instance when using Android. | 76 // Create a GestureConfigurationAura singleton instance when using Android. |
| 79 GestureConfiguration* GestureConfiguration::GetPlatformSpecificInstance() { | 77 GestureConfiguration* GestureConfiguration::GetPlatformSpecificInstance() { |
| 80 return GestureConfigurationAndroid::GetInstance(); | 78 return GestureConfigurationAndroid::GetInstance(); |
| 81 } | 79 } |
| 82 | 80 |
| 83 } // namespace ui | 81 } // namespace ui |
| OLD | NEW |