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

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

Issue 200623003: Adopt "QuickScale" double-tap drag zoom code in the GestureProvider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add pinch coalesce test Created 6 years, 8 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_config_helper.h" 5 #include "ui/events/gesture_detection/gesture_config_helper.h"
6 6
7 #include "ui/gfx/android/view_configuration.h" 7 #include "ui/gfx/android/view_configuration.h"
8 #include "ui/gfx/screen.h" 8 #include "ui/gfx/screen.h"
9 9
10 using gfx::ViewConfiguration; 10 using gfx::ViewConfiguration;
(...skipping 19 matching lines...) Expand all
30 config.scaled_maximum_fling_velocity = 30 config.scaled_maximum_fling_velocity =
31 ViewConfiguration::GetMaximumFlingVelocityInPixelsPerSecond(); 31 ViewConfiguration::GetMaximumFlingVelocityInPixelsPerSecond();
32 32
33 return config; 33 return config;
34 } 34 }
35 35
36 ScaleGestureDetector::Config DefaultScaleGestureDetectorConfig() { 36 ScaleGestureDetector::Config DefaultScaleGestureDetectorConfig() {
37 ScaleGestureDetector::Config config; 37 ScaleGestureDetector::Config config;
38 38
39 config.gesture_detector_config = DefaultGestureDetectorConfig(); 39 config.gesture_detector_config = DefaultGestureDetectorConfig();
40 // TODO(jdduke): Enable "quick scale" on the ScaleGestureDetector, and remove 40 config.quick_scale_enabled = true;
41 // corresponding double tap drag zoom code from GestureProvider, crbug/331092.
42 config.quick_scale_enabled = false;
43 config.min_scaling_touch_major = 41 config.min_scaling_touch_major =
44 ViewConfiguration::GetMinScalingTouchMajorInPixels(); 42 ViewConfiguration::GetMinScalingTouchMajorInPixels();
45 config.min_scaling_span = ViewConfiguration::GetMinScalingSpanInPixels(); 43 config.min_scaling_span = ViewConfiguration::GetMinScalingSpanInPixels();
46 44
47 return config; 45 return config;
48 } 46 }
49 47
50 SnapScrollController::Config DefaultSnapScrollControllerConfig() { 48 SnapScrollController::Config DefaultSnapScrollControllerConfig() {
51 SnapScrollController::Config config; 49 SnapScrollController::Config config;
52 50
53 const gfx::Display& display = 51 const gfx::Display& display =
54 gfx::Screen::GetNativeScreen()->GetPrimaryDisplay(); 52 gfx::Screen::GetNativeScreen()->GetPrimaryDisplay();
55 53
56 config.screen_width_pixels = display.GetSizeInPixel().width(); 54 config.screen_width_pixels = display.GetSizeInPixel().width();
57 config.screen_height_pixels = display.GetSizeInPixel().height(); 55 config.screen_height_pixels = display.GetSizeInPixel().height();
58 config.device_scale_factor = display.device_scale_factor(); 56 config.device_scale_factor = display.device_scale_factor();
59 57
60 return config; 58 return config;
61 } 59 }
62 60
63 GestureProvider::Config DefaultGestureProviderConfig() { 61 GestureProvider::Config DefaultGestureProviderConfig() {
64 GestureProvider::Config config; 62 GestureProvider::Config config;
65 config.gesture_detector_config = DefaultGestureDetectorConfig(); 63 config.gesture_detector_config = DefaultGestureDetectorConfig();
66 config.scale_gesture_detector_config = DefaultScaleGestureDetectorConfig(); 64 config.scale_gesture_detector_config = DefaultScaleGestureDetectorConfig();
67 config.snap_scroll_controller_config = DefaultSnapScrollControllerConfig(); 65 config.snap_scroll_controller_config = DefaultSnapScrollControllerConfig();
68 return config; 66 return config;
69 } 67 }
70 68
71 } // namespace ui 69 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698