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

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

Issue 501503003: Avoid an extra GestureDetector instance for double-tap drag zooming (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix spelling Created 6 years, 4 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 | « no previous file | ui/events/gesture_detection/gesture_config_helper_aura.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 config.maximum_fling_velocity = 42 config.maximum_fling_velocity =
43 ViewConfiguration::GetMaximumFlingVelocityInPixelsPerSecond() * px_to_dp; 43 ViewConfiguration::GetMaximumFlingVelocityInPixelsPerSecond() * px_to_dp;
44 44
45 return config; 45 return config;
46 } 46 }
47 47
48 ScaleGestureDetector::Config DefaultScaleGestureDetectorConfig( 48 ScaleGestureDetector::Config DefaultScaleGestureDetectorConfig(
49 const gfx::Display& display) { 49 const gfx::Display& display) {
50 ScaleGestureDetector::Config config; 50 ScaleGestureDetector::Config config;
51 51
52 config.gesture_detector_config = DefaultGestureDetectorConfig(display);
53 config.quick_scale_enabled = true;
54
55 const float px_to_dp = 1.f / display.device_scale_factor(); 52 const float px_to_dp = 1.f / display.device_scale_factor();
53 config.span_slop = ViewConfiguration::GetTouchSlopInPixels() * 2.f * px_to_dp;
56 config.min_scaling_touch_major = 54 config.min_scaling_touch_major =
57 ViewConfiguration::GetMinScalingTouchMajorInPixels() * px_to_dp; 55 ViewConfiguration::GetMinScalingTouchMajorInPixels() * px_to_dp;
58 config.min_scaling_span = 56 config.min_scaling_span =
59 ViewConfiguration::GetMinScalingSpanInPixels() * px_to_dp; 57 ViewConfiguration::GetMinScalingSpanInPixels() * px_to_dp;
58 config.min_pinch_update_span_delta = 0.f;
60 59
61 return config; 60 return config;
62 } 61 }
63 62
64 } // namespace 63 } // namespace
65 64
66 GestureProvider::Config DefaultGestureProviderConfig() { 65 GestureProvider::Config DefaultGestureProviderConfig() {
67 GestureProvider::Config config; 66 GestureProvider::Config config;
68 config.display = gfx::Screen::GetNativeScreen()->GetPrimaryDisplay(); 67 config.display = gfx::Screen::GetNativeScreen()->GetPrimaryDisplay();
69 config.gesture_detector_config = DefaultGestureDetectorConfig(config.display); 68 config.gesture_detector_config = DefaultGestureDetectorConfig(config.display);
70 config.scale_gesture_detector_config = 69 config.scale_gesture_detector_config =
71 DefaultScaleGestureDetectorConfig(config.display); 70 DefaultScaleGestureDetectorConfig(config.display);
72 config.gesture_begin_end_types_enabled = false; 71 config.gesture_begin_end_types_enabled = false;
73 config.min_gesture_bounds_length = kMinGestureBoundsLengthDips; 72 config.min_gesture_bounds_length = kMinGestureBoundsLengthDips;
74 config.max_gesture_bounds_length = kMaxGestureBoundsLengthDips; 73 config.max_gesture_bounds_length = kMaxGestureBoundsLengthDips;
75 return config; 74 return config;
76 } 75 }
77 76
78 } // namespace ui 77 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | ui/events/gesture_detection/gesture_config_helper_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698