platformKeys: Add per-extension sign permissions.
[chromium-blink-merge.git] / ui / events / gesture_detection / gesture_configuration_aura.cc
blob6836ef0958cbc7f2aecf0bfa2c44e7dbc67ec102
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 "ui/events/event_switches.h"
10 namespace ui {
11 namespace {
13 class GestureConfigurationAura : public GestureConfiguration {
14 public:
15 ~GestureConfigurationAura() override {
18 static GestureConfigurationAura* GetInstance() {
19 return Singleton<GestureConfigurationAura>::get();
22 private:
23 GestureConfigurationAura() : GestureConfiguration() {
24 set_double_tap_enabled(false);
25 set_double_tap_timeout_in_ms(semi_long_press_time_in_ms());
26 set_gesture_begin_end_types_enabled(true);
27 set_min_gesture_bounds_length(default_radius());
28 set_min_pinch_update_span_delta(
29 base::CommandLine::ForCurrentProcess()->HasSwitch(
30 switches::kCompensateForUnstablePinchZoom)
31 ? 5
32 : 0);
33 set_min_scaling_touch_major(default_radius() * 2);
34 set_velocity_tracker_strategy(VelocityTracker::Strategy::LSQ2_RESTRICTED);
35 set_span_slop(max_touch_move_in_pixels_for_click() * 2);
36 set_swipe_enabled(true);
37 set_two_finger_tap_enabled(true);
40 friend struct DefaultSingletonTraits<GestureConfigurationAura>;
41 DISALLOW_COPY_AND_ASSIGN(GestureConfigurationAura);
44 } // namespace
46 // Create a GestureConfigurationAura singleton instance when using aura.
47 GestureConfiguration* GestureConfiguration::GetInstance() {
48 return GestureConfigurationAura::GetInstance();
51 } // namespace ui