Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(631)

Side by Side Diff: ui/events/gesture_detection/gesture_configuration_aura.cc

Issue 1778063002: Eliminate pinch drift by removing touch radius from span calculation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Shrink minimum scale span. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/command_line.h" 7 #include "base/command_line.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/singleton.h" 9 #include "base/memory/singleton.h"
10 #include "ui/events/event_switches.h" 10 #include "ui/events/event_switches.h"
(...skipping 14 matching lines...) Expand all
25 GestureConfigurationAura() : GestureConfiguration() { 25 GestureConfigurationAura() : GestureConfiguration() {
26 set_double_tap_enabled(false); 26 set_double_tap_enabled(false);
27 set_double_tap_timeout_in_ms(semi_long_press_time_in_ms()); 27 set_double_tap_timeout_in_ms(semi_long_press_time_in_ms());
28 set_gesture_begin_end_types_enabled(true); 28 set_gesture_begin_end_types_enabled(true);
29 set_min_gesture_bounds_length(default_radius()); 29 set_min_gesture_bounds_length(default_radius());
30 set_min_pinch_update_span_delta( 30 set_min_pinch_update_span_delta(
31 base::CommandLine::ForCurrentProcess()->HasSwitch( 31 base::CommandLine::ForCurrentProcess()->HasSwitch(
32 switches::kCompensateForUnstablePinchZoom) 32 switches::kCompensateForUnstablePinchZoom)
33 ? 5 33 ? 5
34 : 0); 34 : 0);
35 set_min_scaling_touch_major(default_radius() * 2);
36 set_velocity_tracker_strategy(VelocityTracker::Strategy::LSQ2_RESTRICTED); 35 set_velocity_tracker_strategy(VelocityTracker::Strategy::LSQ2_RESTRICTED);
37 set_span_slop(max_touch_move_in_pixels_for_click() * 2); 36 set_span_slop(max_touch_move_in_pixels_for_click() * 2);
38 set_swipe_enabled(true); 37 set_swipe_enabled(true);
39 set_two_finger_tap_enabled(true); 38 set_two_finger_tap_enabled(true);
40 set_fling_touchpad_tap_suppression_enabled(true); 39 set_fling_touchpad_tap_suppression_enabled(true);
41 set_fling_touchscreen_tap_suppression_enabled(true); 40 set_fling_touchscreen_tap_suppression_enabled(true);
42 } 41 }
43 42
44 friend struct base::DefaultSingletonTraits<GestureConfigurationAura>; 43 friend struct base::DefaultSingletonTraits<GestureConfigurationAura>;
45 DISALLOW_COPY_AND_ASSIGN(GestureConfigurationAura); 44 DISALLOW_COPY_AND_ASSIGN(GestureConfigurationAura);
46 }; 45 };
47 46
48 } // namespace 47 } // namespace
49 48
50 // Create a GestureConfigurationAura singleton instance when using aura. 49 // Create a GestureConfigurationAura singleton instance when using aura.
51 GestureConfiguration* GestureConfiguration::GetPlatformSpecificInstance() { 50 GestureConfiguration* GestureConfiguration::GetPlatformSpecificInstance() {
52 return GestureConfigurationAura::GetInstance(); 51 return GestureConfigurationAura::GetInstance();
53 } 52 }
54 53
55 } // namespace ui 54 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698