OLD | NEW |
---|---|
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 // MSVC++ requires this to be set before any other includes to get M_PI. | 5 // MSVC++ requires this to be set before any other includes to get M_PI. |
6 #define _USE_MATH_DEFINES | 6 #define _USE_MATH_DEFINES |
7 | 7 |
8 #include "ui/events/gesture_detection/gesture_config_helper.h" | 8 #include "ui/events/gesture_detection/gesture_config_helper.h" |
9 | 9 |
10 #include <cmath> | 10 #include <cmath> |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
60 config.min_scaling_touch_major = GestureConfiguration::default_radius() * 2; | 60 config.min_scaling_touch_major = GestureConfiguration::default_radius() * 2; |
61 config.min_scaling_span = GestureConfiguration::min_scaling_span_in_pixels(); | 61 config.min_scaling_span = GestureConfiguration::min_scaling_span_in_pixels(); |
62 config.min_pinch_update_span_delta = min_pinch_update_distance; | 62 config.min_pinch_update_span_delta = min_pinch_update_distance; |
63 return config; | 63 return config; |
64 } | 64 } |
65 | 65 |
66 } // namespace | 66 } // namespace |
67 | 67 |
68 GestureProvider::Config DefaultGestureProviderConfig() { | 68 GestureProvider::Config DefaultGestureProviderConfig() { |
69 GestureProvider::Config config; | 69 GestureProvider::Config config; |
70 config.display = gfx::Screen::GetNativeScreen()->GetPrimaryDisplay(); | 70 gfx::Screen* screen = gfx::Screen::GetScreenByType(gfx::SCREEN_TYPE_NATIVE); |
71 if (screen) | |
jdduke (slow)
2014/07/30 15:29:32
This is scary, when will this be null? Should we b
tdresser
2014/07/31 15:33:31
Added a comment indicating that |screen| is someti
| |
72 config.display = screen->GetPrimaryDisplay(); | |
71 config.gesture_detector_config = DefaultGestureDetectorConfig(); | 73 config.gesture_detector_config = DefaultGestureDetectorConfig(); |
72 config.scale_gesture_detector_config = DefaultScaleGestureDetectorConfig(); | 74 config.scale_gesture_detector_config = DefaultScaleGestureDetectorConfig(); |
73 config.gesture_begin_end_types_enabled = true; | 75 config.gesture_begin_end_types_enabled = true; |
74 // Half the size of the default touch length is a reasonable minimum. | 76 // Half the size of the default touch length is a reasonable minimum. |
75 config.min_gesture_bounds_length = GestureConfiguration::default_radius(); | 77 config.min_gesture_bounds_length = GestureConfiguration::default_radius(); |
76 return config; | 78 return config; |
77 } | 79 } |
78 | 80 |
79 } // namespace ui | 81 } // namespace ui |
OLD | NEW |