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

Side by Side Diff: ui/mojo/init/ui_init.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
« no previous file with comments | « ui/gfx/android/view_configuration.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/mojo/init/ui_init.h" 5 #include "ui/mojo/init/ui_init.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/memory/singleton.h" 8 #include "base/memory/singleton.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "ui/mojo/init/screen_mojo.h" 10 #include "ui/mojo/init/screen_mojo.h"
11 11
12 #if defined(OS_ANDROID) 12 #if defined(OS_ANDROID)
13 #include "ui/events/gesture_detection/gesture_configuration.h" // nogncheck 13 #include "ui/events/gesture_detection/gesture_configuration.h" // nogncheck
14 #endif 14 #endif
15 15
16 namespace ui { 16 namespace ui {
17 namespace mojo { 17 namespace mojo {
18 18
19 #if defined(OS_ANDROID) 19 #if defined(OS_ANDROID)
20 // TODO(sky): this needs to come from system. 20 // TODO(sky): this needs to come from system.
21 class GestureConfigurationMojo : public ui::GestureConfiguration { 21 class GestureConfigurationMojo : public ui::GestureConfiguration {
22 public: 22 public:
23 GestureConfigurationMojo() : GestureConfiguration() { 23 GestureConfigurationMojo() : GestureConfiguration() {
24 set_double_tap_enabled(false); 24 set_double_tap_enabled(false);
25 set_double_tap_timeout_in_ms(semi_long_press_time_in_ms()); 25 set_double_tap_timeout_in_ms(semi_long_press_time_in_ms());
26 set_gesture_begin_end_types_enabled(true); 26 set_gesture_begin_end_types_enabled(true);
27 set_min_gesture_bounds_length(default_radius()); 27 set_min_gesture_bounds_length(default_radius());
28 set_min_pinch_update_span_delta(0); 28 set_min_pinch_update_span_delta(0);
29 set_min_scaling_touch_major(default_radius() * 2);
30 set_velocity_tracker_strategy( 29 set_velocity_tracker_strategy(
31 ui::VelocityTracker::Strategy::LSQ2_RESTRICTED); 30 ui::VelocityTracker::Strategy::LSQ2_RESTRICTED);
32 set_span_slop(max_touch_move_in_pixels_for_click() * 2); 31 set_span_slop(max_touch_move_in_pixels_for_click() * 2);
33 set_swipe_enabled(true); 32 set_swipe_enabled(true);
34 set_two_finger_tap_enabled(true); 33 set_two_finger_tap_enabled(true);
35 } 34 }
36 35
37 ~GestureConfigurationMojo() override {} 36 ~GestureConfigurationMojo() override {}
38 37
39 private: 38 private:
(...skipping 12 matching lines...) Expand all
52 51
53 UIInit::~UIInit() { 52 UIInit::~UIInit() {
54 gfx::Screen::SetScreenInstance(nullptr); 53 gfx::Screen::SetScreenInstance(nullptr);
55 #if defined(OS_ANDROID) 54 #if defined(OS_ANDROID)
56 ui::GestureConfiguration::SetInstance(nullptr); 55 ui::GestureConfiguration::SetInstance(nullptr);
57 #endif 56 #endif
58 } 57 }
59 58
60 } // namespace mojo 59 } // namespace mojo
61 } // namespace ui 60 } // namespace ui
OLDNEW
« no previous file with comments | « ui/gfx/android/view_configuration.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698