| 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 #include "ui/events/gesture_detection/gesture_provider_config_helper.h" | 5 #include "ui/events/gesture_detection/gesture_provider_config_helper.h" |
| 6 | 6 |
| 7 #include "ui/events/gesture_detection/gesture_configuration.h" | 7 #include "ui/events/gesture_detection/gesture_configuration.h" |
| 8 #include "ui/gfx/screen.h" | 8 #include "ui/gfx/screen.h" |
| 9 | 9 |
| 10 namespace ui { | 10 namespace ui { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 config.maximum_fling_velocity = gesture_config.max_fling_velocity(); | 34 config.maximum_fling_velocity = gesture_config.max_fling_velocity(); |
| 35 config.swipe_enabled = gesture_config.swipe_enabled(); | 35 config.swipe_enabled = gesture_config.swipe_enabled(); |
| 36 config.minimum_swipe_velocity = gesture_config.min_swipe_velocity(); | 36 config.minimum_swipe_velocity = gesture_config.min_swipe_velocity(); |
| 37 config.maximum_swipe_deviation_angle = | 37 config.maximum_swipe_deviation_angle = |
| 38 gesture_config.max_swipe_deviation_angle(); | 38 gesture_config.max_swipe_deviation_angle(); |
| 39 config.two_finger_tap_enabled = gesture_config.two_finger_tap_enabled(); | 39 config.two_finger_tap_enabled = gesture_config.two_finger_tap_enabled(); |
| 40 config.two_finger_tap_max_separation = | 40 config.two_finger_tap_max_separation = |
| 41 gesture_config.max_distance_for_two_finger_tap_in_pixels(); | 41 gesture_config.max_distance_for_two_finger_tap_in_pixels(); |
| 42 config.two_finger_tap_timeout = base::TimeDelta::FromMilliseconds( | 42 config.two_finger_tap_timeout = base::TimeDelta::FromMilliseconds( |
| 43 gesture_config.max_touch_down_duration_for_click_in_ms()); | 43 gesture_config.max_touch_down_duration_for_click_in_ms()); |
| 44 config.single_tap_repeat_length = gesture_config.max_tap_count(); |
| 44 config.velocity_tracker_strategy = gesture_config.velocity_tracker_strategy(); | 45 config.velocity_tracker_strategy = gesture_config.velocity_tracker_strategy(); |
| 45 return config; | 46 return config; |
| 46 } | 47 } |
| 47 | 48 |
| 48 ScaleGestureDetector::Config BuildScaleGestureDetectorConfig( | 49 ScaleGestureDetector::Config BuildScaleGestureDetectorConfig( |
| 49 const GestureConfiguration& gesture_config) { | 50 const GestureConfiguration& gesture_config) { |
| 50 ScaleGestureDetector::Config config; | 51 ScaleGestureDetector::Config config; |
| 51 config.span_slop = gesture_config.span_slop(); | 52 config.span_slop = gesture_config.span_slop(); |
| 52 config.min_scaling_touch_major = gesture_config.min_scaling_touch_major(); | 53 config.min_scaling_touch_major = gesture_config.min_scaling_touch_major(); |
| 53 config.min_scaling_span = gesture_config.min_scaling_span_in_pixels(); | 54 config.min_scaling_span = gesture_config.min_scaling_span_in_pixels(); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 | 91 |
| 91 gfx::Screen* screen = gfx::Screen::GetScreenByType(gfx::SCREEN_TYPE_NATIVE); | 92 gfx::Screen* screen = gfx::Screen::GetScreenByType(gfx::SCREEN_TYPE_NATIVE); |
| 92 // |screen| is sometimes NULL during tests. | 93 // |screen| is sometimes NULL during tests. |
| 93 if (screen) | 94 if (screen) |
| 94 config.display = screen->GetPrimaryDisplay(); | 95 config.display = screen->GetPrimaryDisplay(); |
| 95 | 96 |
| 96 return config; | 97 return config; |
| 97 } | 98 } |
| 98 | 99 |
| 99 } // namespace ui | 100 } // namespace ui |
| OLD | NEW |