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 #include <cmath> |
| 8 |
| 9 namespace ui { |
| 10 namespace { |
| 11 |
| 12 class GESTURE_DETECTION_EXPORT GestureConfigurationAura |
| 13 : public GestureConfiguration { |
| 14 public: |
| 15 static GestureConfigurationAura* GetInstance() { |
| 16 return Singleton<GestureConfigurationAura>::get(); |
| 17 } |
| 18 |
| 19 private: |
| 20 GestureConfigurationAura() : GestureConfiguration() { |
| 21 set_double_tap_timeout_in_ms(semi_long_press_time_in_ms()); |
| 22 set_gesture_begin_end_types_enabled(true); |
| 23 set_min_gesture_bounds_length(default_radius()); |
| 24 set_min_pinch_update_distance_in_pixels(5); |
| 25 set_min_pinch_update_span_delta( |
| 26 CommandLine::ForCurrentProcess()->HasSwitch( |
| 27 switches::kCompensateForUnstablePinchZoom) |
| 28 ? min_pinch_update_distance_in_pixels() |
| 29 : 0); |
| 30 set_min_scaling_touch_major(default_radius() * 2); |
| 31 set_span_slop(max_touch_move_in_pixels_for_click() * 2); |
| 32 set_swipe_enabled(true); |
| 33 set_two_finger_tap_enabled(true); |
| 34 } |
| 35 friend struct DefaultSingletonTraits<GestureConfigurationAura>; |
| 36 DISALLOW_COPY_AND_ASSIGN(GestureConfigurationAura); |
| 37 }; |
| 38 |
| 39 } // namespace |
| 40 |
| 41 GestureConfiguration* GestureConfiguration::GetInstance() { |
| 42 return GestureConfigurationAura::GetInstance(); |
| 43 } |
| 44 |
| 45 GestureProvider::Config DefaultGestureProviderConfig() { |
| 46 return GestureConfigurationAura::GetInstance() |
| 47 ->DefaultGestureProviderConfig(); |
| 48 } |
| 49 |
| 50 } // namespace ui |
OLD | NEW |