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.
5 #include "ui/events/gesture_detection/gesture_configuration.h"
7 #include "base/command_line.h"
8 #include "base/memory/singleton.h"
9 #include "ui/events/event_switches.h"
14 class GestureConfigurationAura
: public GestureConfiguration
{
16 ~GestureConfigurationAura() override
{
19 static GestureConfigurationAura
* GetInstance() {
20 return Singleton
<GestureConfigurationAura
>::get();
24 GestureConfigurationAura() : GestureConfiguration() {
25 set_double_tap_enabled(false);
26 set_double_tap_timeout_in_ms(semi_long_press_time_in_ms());
27 set_gesture_begin_end_types_enabled(true);
28 set_min_gesture_bounds_length(default_radius());
29 set_min_pinch_update_span_delta(
30 base::CommandLine::ForCurrentProcess()->HasSwitch(
31 switches::kCompensateForUnstablePinchZoom
)
34 set_min_scaling_touch_major(default_radius() * 2);
35 set_velocity_tracker_strategy(VelocityTracker::Strategy::LSQ2_RESTRICTED
);
36 set_span_slop(max_touch_move_in_pixels_for_click() * 2);
37 set_swipe_enabled(true);
38 set_two_finger_tap_enabled(true);
41 friend struct DefaultSingletonTraits
<GestureConfigurationAura
>;
42 DISALLOW_COPY_AND_ASSIGN(GestureConfigurationAura
);
47 // Create a GestureConfigurationAura singleton instance when using aura.
48 GestureConfiguration
* GestureConfiguration::GetPlatformSpecificInstance() {
49 return GestureConfigurationAura::GetInstance();