| 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/memory/singleton.h" | 7 #include "base/memory/singleton.h" |
| 8 #include "ui/gfx/android/view_configuration.h" | 8 #include "ui/gfx/android/view_configuration.h" |
| 9 #include "ui/gfx/screen.h" | 9 #include "ui/gfx/screen.h" |
| 10 | 10 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 } | 26 } |
| 27 | 27 |
| 28 static GestureConfigurationAndroid* GetInstance() { | 28 static GestureConfigurationAndroid* GetInstance() { |
| 29 return Singleton<GestureConfigurationAndroid>::get(); | 29 return Singleton<GestureConfigurationAndroid>::get(); |
| 30 } | 30 } |
| 31 | 31 |
| 32 private: | 32 private: |
| 33 GestureConfigurationAndroid() : GestureConfiguration() { | 33 GestureConfigurationAndroid() : GestureConfiguration() { |
| 34 set_double_tap_enabled(true); | 34 set_double_tap_enabled(true); |
| 35 set_double_tap_timeout_in_ms(ViewConfiguration::GetDoubleTapTimeoutInMs()); | 35 set_double_tap_timeout_in_ms(ViewConfiguration::GetDoubleTapTimeoutInMs()); |
| 36 #if defined(USE_AURA) |
| 37 set_gesture_begin_end_types_enabled(true); |
| 38 #else |
| 36 set_gesture_begin_end_types_enabled(false); | 39 set_gesture_begin_end_types_enabled(false); |
| 40 #endif |
| 37 set_long_press_time_in_ms(ViewConfiguration::GetLongPressTimeoutInMs()); | 41 set_long_press_time_in_ms(ViewConfiguration::GetLongPressTimeoutInMs()); |
| 38 set_max_distance_between_taps_for_double_tap( | 42 set_max_distance_between_taps_for_double_tap( |
| 39 ViewConfiguration::GetDoubleTapSlopInDips()); | 43 ViewConfiguration::GetDoubleTapSlopInDips()); |
| 40 set_max_fling_velocity( | 44 set_max_fling_velocity( |
| 41 ViewConfiguration::GetMaximumFlingVelocityInDipsPerSecond()); | 45 ViewConfiguration::GetMaximumFlingVelocityInDipsPerSecond()); |
| 42 set_max_gesture_bounds_length(kMaxGestureBoundsLengthDips); | 46 set_max_gesture_bounds_length(kMaxGestureBoundsLengthDips); |
| 43 set_max_touch_move_in_pixels_for_click( | 47 set_max_touch_move_in_pixels_for_click( |
| 44 ViewConfiguration::GetTouchSlopInDips()); | 48 ViewConfiguration::GetTouchSlopInDips()); |
| 45 set_min_fling_velocity( | 49 set_min_fling_velocity( |
| 46 ViewConfiguration::GetMinimumFlingVelocityInDipsPerSecond()); | 50 ViewConfiguration::GetMinimumFlingVelocityInDipsPerSecond()); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 65 }; | 69 }; |
| 66 | 70 |
| 67 } // namespace | 71 } // namespace |
| 68 | 72 |
| 69 // Create a GestureConfigurationAura singleton instance when using Android. | 73 // Create a GestureConfigurationAura singleton instance when using Android. |
| 70 GestureConfiguration* GestureConfiguration::GetPlatformSpecificInstance() { | 74 GestureConfiguration* GestureConfiguration::GetPlatformSpecificInstance() { |
| 71 return GestureConfigurationAndroid::GetInstance(); | 75 return GestureConfigurationAndroid::GetInstance(); |
| 72 } | 76 } |
| 73 | 77 |
| 74 } // namespace ui | 78 } // namespace ui |
| OLD | NEW |