| 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 "ui/gfx/android/view_configuration.h" | 7 #include "ui/gfx/android/view_configuration.h" |
| 8 #include "ui/gfx/screen.h" | 8 #include "ui/gfx/screen.h" |
| 9 | 9 |
| 10 using gfx::ViewConfiguration; | 10 using gfx::ViewConfiguration; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 static GestureConfigurationAndroid* GetInstance() { | 27 static GestureConfigurationAndroid* GetInstance() { |
| 28 return Singleton<GestureConfigurationAndroid>::get(); | 28 return Singleton<GestureConfigurationAndroid>::get(); |
| 29 } | 29 } |
| 30 | 30 |
| 31 private: | 31 private: |
| 32 GestureConfigurationAndroid() : GestureConfiguration() { | 32 GestureConfigurationAndroid() : GestureConfiguration() { |
| 33 float raw_pixel_to_dip_ratio = 1.f / gfx::Screen::GetNativeScreen() | 33 float raw_pixel_to_dip_ratio = 1.f / gfx::Screen::GetNativeScreen() |
| 34 ->GetPrimaryDisplay() | 34 ->GetPrimaryDisplay() |
| 35 .device_scale_factor(); | 35 .device_scale_factor(); |
| 36 set_double_tap_enabled(true); |
| 36 set_double_tap_timeout_in_ms(ViewConfiguration::GetDoubleTapTimeoutInMs()); | 37 set_double_tap_timeout_in_ms(ViewConfiguration::GetDoubleTapTimeoutInMs()); |
| 37 set_gesture_begin_end_types_enabled(false); | 38 set_gesture_begin_end_types_enabled(false); |
| 38 set_long_press_time_in_ms(ViewConfiguration::GetLongPressTimeoutInMs()); | 39 set_long_press_time_in_ms(ViewConfiguration::GetLongPressTimeoutInMs()); |
| 39 set_max_distance_between_taps_for_double_tap( | 40 set_max_distance_between_taps_for_double_tap( |
| 40 ViewConfiguration::GetDoubleTapSlopInPixels() * raw_pixel_to_dip_ratio); | 41 ViewConfiguration::GetDoubleTapSlopInPixels() * raw_pixel_to_dip_ratio); |
| 41 set_max_fling_velocity( | 42 set_max_fling_velocity( |
| 42 ViewConfiguration::GetMaximumFlingVelocityInPixelsPerSecond() * | 43 ViewConfiguration::GetMaximumFlingVelocityInPixelsPerSecond() * |
| 43 raw_pixel_to_dip_ratio); | 44 raw_pixel_to_dip_ratio); |
| 44 set_max_gesture_bounds_length(kMaxGestureBoundsLengthDips); | 45 set_max_gesture_bounds_length(kMaxGestureBoundsLengthDips); |
| 45 set_max_touch_move_in_pixels_for_click( | 46 set_max_touch_move_in_pixels_for_click( |
| (...skipping 19 matching lines...) Expand all Loading... |
| 65 }; | 66 }; |
| 66 | 67 |
| 67 } // namespace | 68 } // namespace |
| 68 | 69 |
| 69 // Create a GestureConfigurationAura singleton instance when using Android. | 70 // Create a GestureConfigurationAura singleton instance when using Android. |
| 70 GestureConfiguration* GestureConfiguration::GetInstance() { | 71 GestureConfiguration* GestureConfiguration::GetInstance() { |
| 71 return GestureConfigurationAndroid::GetInstance(); | 72 return GestureConfigurationAndroid::GetInstance(); |
| 72 } | 73 } |
| 73 | 74 |
| 74 } // namespace ui | 75 } // namespace ui |
| OLD | NEW |