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

Side by Side Diff: ui/events/gesture_detection/gesture_configuration_android.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/android/build_info.h" 7 #include "base/android/build_info.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/gfx/android/view_configuration.h" 10 #include "ui/gfx/android/view_configuration.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 ViewConfiguration::GetMaximumFlingVelocityInDipsPerSecond()); 50 ViewConfiguration::GetMaximumFlingVelocityInDipsPerSecond());
51 set_max_gesture_bounds_length(kMaxGestureBoundsLengthDips); 51 set_max_gesture_bounds_length(kMaxGestureBoundsLengthDips);
52 set_max_touch_move_in_pixels_for_click( 52 set_max_touch_move_in_pixels_for_click(
53 ViewConfiguration::GetTouchSlopInDips()); 53 ViewConfiguration::GetTouchSlopInDips());
54 set_min_fling_velocity( 54 set_min_fling_velocity(
55 ViewConfiguration::GetMinimumFlingVelocityInDipsPerSecond()); 55 ViewConfiguration::GetMinimumFlingVelocityInDipsPerSecond());
56 set_min_gesture_bounds_length(kMinGestureBoundsLengthDips); 56 set_min_gesture_bounds_length(kMinGestureBoundsLengthDips);
57 set_min_pinch_update_span_delta(0.f); 57 set_min_pinch_update_span_delta(0.f);
58 set_min_scaling_span_in_pixels( 58 set_min_scaling_span_in_pixels(
59 ViewConfiguration::GetMinScalingSpanInDips()); 59 ViewConfiguration::GetMinScalingSpanInDips());
60 set_min_scaling_touch_major(
61 ViewConfiguration::GetMinScalingTouchMajorInDips());
62 set_show_press_delay_in_ms(ViewConfiguration::GetTapTimeoutInMs()); 60 set_show_press_delay_in_ms(ViewConfiguration::GetTapTimeoutInMs());
63 set_span_slop(ViewConfiguration::GetTouchSlopInDips() * 2.f); 61 set_span_slop(ViewConfiguration::GetTouchSlopInDips() * 2.f);
64 set_fling_touchscreen_tap_suppression_enabled(true); 62 set_fling_touchscreen_tap_suppression_enabled(true);
65 set_fling_touchpad_tap_suppression_enabled(false); 63 set_fling_touchpad_tap_suppression_enabled(false);
66 set_fling_max_cancel_to_down_time_in_ms( 64 set_fling_max_cancel_to_down_time_in_ms(
67 ViewConfiguration::GetTapTimeoutInMs()); 65 ViewConfiguration::GetTapTimeoutInMs());
68 set_fling_max_tap_gap_time_in_ms( 66 set_fling_max_tap_gap_time_in_ms(
69 ViewConfiguration::GetLongPressTimeoutInMs()); 67 ViewConfiguration::GetLongPressTimeoutInMs());
70 } 68 }
71 69
72 friend struct base::DefaultSingletonTraits<GestureConfigurationAndroid>; 70 friend struct base::DefaultSingletonTraits<GestureConfigurationAndroid>;
73 DISALLOW_COPY_AND_ASSIGN(GestureConfigurationAndroid); 71 DISALLOW_COPY_AND_ASSIGN(GestureConfigurationAndroid);
74 }; 72 };
75 73
76 } // namespace 74 } // namespace
77 75
78 // Create a GestureConfigurationAura singleton instance when using Android. 76 // Create a GestureConfigurationAura singleton instance when using Android.
79 GestureConfiguration* GestureConfiguration::GetPlatformSpecificInstance() { 77 GestureConfiguration* GestureConfiguration::GetPlatformSpecificInstance() {
80 return GestureConfigurationAndroid::GetInstance(); 78 return GestureConfigurationAndroid::GetInstance();
81 } 79 }
82 80
83 } // namespace ui 81 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/gesture_detection/gesture_configuration.cc ('k') | ui/events/gesture_detection/gesture_configuration_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698