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_provider_config_helper.cc

Issue 1358263002: [Android] Support double-tap selection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix contextual search Created 5 years, 2 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_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
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_interval = 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
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
OLDNEW
« no previous file with comments | « ui/events/gesture_detection/gesture_provider.cc ('k') | ui/events/gesture_detection/gesture_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698