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

Side by Side Diff: ui/events/gesture_detection/gesture_config_helper_aura.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: Yeah... 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/events/gestures/gesture_configuration.h" 7 #include "ui/events/gestures/gesture_configuration.h"
8 #include "ui/gfx/screen.h" 8 #include "ui/gfx/screen.h"
9 9
10 namespace ui { 10 namespace ui {
(...skipping 16 matching lines...) Expand all
27 config.scaled_maximum_fling_velocity = 27 config.scaled_maximum_fling_velocity =
28 GestureConfiguration::fling_velocity_cap(); 28 GestureConfiguration::fling_velocity_cap();
29 29
30 return config; 30 return config;
31 } 31 }
32 32
33 ScaleGestureDetector::Config DefaultScaleGestureDetectorConfig() { 33 ScaleGestureDetector::Config DefaultScaleGestureDetectorConfig() {
34 ScaleGestureDetector::Config config; 34 ScaleGestureDetector::Config config;
35 35
36 config.gesture_detector_config = DefaultGestureDetectorConfig(); 36 config.gesture_detector_config = DefaultGestureDetectorConfig();
37 config.quick_scale_enabled = false;
38 config.min_scaling_touch_major = GestureConfiguration::default_radius() / 2; 37 config.min_scaling_touch_major = GestureConfiguration::default_radius() / 2;
39 config.min_scaling_span = 38 config.min_scaling_span =
40 GestureConfiguration::min_distance_for_pinch_scroll_in_pixels(); 39 GestureConfiguration::min_distance_for_pinch_scroll_in_pixels();
41 return config; 40 return config;
42 } 41 }
43 42
44 SnapScrollController::Config DefaultSnapScrollControllerConfig() { 43 SnapScrollController::Config DefaultSnapScrollControllerConfig() {
45 SnapScrollController::Config config; 44 SnapScrollController::Config config;
46 45
47 const gfx::Display& display = 46 const gfx::Display& display =
48 gfx::Screen::GetNativeScreen()->GetPrimaryDisplay(); 47 gfx::Screen::GetNativeScreen()->GetPrimaryDisplay();
49 48
50 config.screen_width_pixels = display.GetSizeInPixel().width(); 49 config.screen_width_pixels = display.GetSizeInPixel().width();
51 config.screen_height_pixels = display.GetSizeInPixel().height(); 50 config.screen_height_pixels = display.GetSizeInPixel().height();
52 config.device_scale_factor = display.device_scale_factor(); 51 config.device_scale_factor = display.device_scale_factor();
53 52
54 return config; 53 return config;
55 } 54 }
56 55
57 GestureProvider::Config DefaultGestureProviderConfig() { 56 GestureProvider::Config DefaultGestureProviderConfig() {
58 GestureProvider::Config config; 57 GestureProvider::Config config;
59 config.gesture_detector_config = DefaultGestureDetectorConfig(); 58 config.gesture_detector_config = DefaultGestureDetectorConfig();
60 config.scale_gesture_detector_config = DefaultScaleGestureDetectorConfig(); 59 config.scale_gesture_detector_config = DefaultScaleGestureDetectorConfig();
61 config.snap_scroll_controller_config = DefaultSnapScrollControllerConfig(); 60 config.snap_scroll_controller_config = DefaultSnapScrollControllerConfig();
62 return config; 61 return config;
63 } 62 }
64 63
65 } // namespace ui 64 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/gesture_detection/gesture_config_helper_android.cc ('k') | ui/events/gesture_detection/gesture_detector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698