OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef UI_BASE_GESTURES_GESTURE_CONFIGURATION_H_ | 5 #ifndef UI_BASE_GESTURES_GESTURE_CONFIGURATION_H_ |
6 #define UI_BASE_GESTURES_GESTURE_CONFIGURATION_H_ | 6 #define UI_BASE_GESTURES_GESTURE_CONFIGURATION_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "ui/base/ui_export.h" | 10 #include "ui/base/ui_export.h" |
11 | 11 |
12 namespace ui { | 12 namespace ui { |
13 | 13 |
14 // TODO: Expand this design to support multiple OS configuration | 14 // TODO: Expand this design to support multiple OS configuration |
15 // approaches (windows, chrome, others). This would turn into an | 15 // approaches (windows, chrome, others). This would turn into an |
16 // abstract base class. | 16 // abstract base class. |
17 | 17 |
18 class UI_EXPORT GestureConfiguration { | 18 class UI_EXPORT GestureConfiguration { |
19 public: | 19 public: |
20 // Ordered alphabetically ignoring underscores, to align with the | 20 // Ordered alphabetically ignoring underscores, to align with the |
21 // associated list of prefs in gesture_prefs_aura.cc. | 21 // associated list of prefs in gesture_prefs_aura.cc. |
22 static int default_radius() { | 22 static int default_radius() { |
23 return default_radius_; | 23 return default_radius_; |
24 } | 24 } |
25 static double long_press_time_in_seconds() { | 25 static double long_press_time_in_seconds() { |
26 return long_press_time_in_seconds_; | 26 return long_press_time_in_seconds_; |
27 } | 27 } |
| 28 static double semi_long_press_time_in_seconds() { |
| 29 return semi_long_press_time_in_seconds_; |
| 30 } |
28 static double max_distance_for_two_finger_tap_in_pixels() { | 31 static double max_distance_for_two_finger_tap_in_pixels() { |
29 return max_distance_for_two_finger_tap_in_pixels_; | 32 return max_distance_for_two_finger_tap_in_pixels_; |
30 } | 33 } |
31 static void set_max_distance_for_two_finger_tap_in_pixels(double val) { | 34 static void set_max_distance_for_two_finger_tap_in_pixels(double val) { |
32 max_distance_for_two_finger_tap_in_pixels_ = val; | 35 max_distance_for_two_finger_tap_in_pixels_ = val; |
33 } | 36 } |
34 static int max_radius() { | 37 static int max_radius() { |
35 return max_radius_; | 38 return max_radius_; |
36 } | 39 } |
37 static void set_long_press_time_in_seconds(double val) { | 40 static void set_long_press_time_in_seconds(double val) { |
38 long_press_time_in_seconds_ = val; | 41 long_press_time_in_seconds_ = val; |
39 } | 42 } |
| 43 static void set_semi_long_press_time_in_seconds(double val) { |
| 44 semi_long_press_time_in_seconds_ = val; |
| 45 } |
40 static double max_seconds_between_double_click() { | 46 static double max_seconds_between_double_click() { |
41 return max_seconds_between_double_click_; | 47 return max_seconds_between_double_click_; |
42 } | 48 } |
43 static void set_max_seconds_between_double_click(double val) { | 49 static void set_max_seconds_between_double_click(double val) { |
44 max_seconds_between_double_click_ = val; | 50 max_seconds_between_double_click_ = val; |
45 } | 51 } |
46 static int max_separation_for_gesture_touches_in_pixels() { | 52 static int max_separation_for_gesture_touches_in_pixels() { |
47 return max_separation_for_gesture_touches_in_pixels_; | 53 return max_separation_for_gesture_touches_in_pixels_; |
48 } | 54 } |
49 static void set_max_separation_for_gesture_touches_in_pixels(int val) { | 55 static void set_max_separation_for_gesture_touches_in_pixels(int val) { |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 // The maximum allowed distance between two fingers for a two finger tap. If | 146 // The maximum allowed distance between two fingers for a two finger tap. If |
141 // the distance between two fingers is greater than this value, we will not | 147 // the distance between two fingers is greater than this value, we will not |
142 // recognize a two finger tap. | 148 // recognize a two finger tap. |
143 static double max_distance_for_two_finger_tap_in_pixels_; | 149 static double max_distance_for_two_finger_tap_in_pixels_; |
144 | 150 |
145 // The maximum allowed size for the radius of a touch region used in | 151 // The maximum allowed size for the radius of a touch region used in |
146 // forming an ET_GESTURE_TAP event. | 152 // forming an ET_GESTURE_TAP event. |
147 static int max_radius_; | 153 static int max_radius_; |
148 | 154 |
149 static double long_press_time_in_seconds_; | 155 static double long_press_time_in_seconds_; |
| 156 static double semi_long_press_time_in_seconds_; |
150 static double max_seconds_between_double_click_; | 157 static double max_seconds_between_double_click_; |
151 static double max_separation_for_gesture_touches_in_pixels_; | 158 static double max_separation_for_gesture_touches_in_pixels_; |
152 static double max_swipe_deviation_ratio_; | 159 static double max_swipe_deviation_ratio_; |
153 static double max_touch_down_duration_in_seconds_for_click_; | 160 static double max_touch_down_duration_in_seconds_for_click_; |
154 static double max_touch_move_in_pixels_for_click_; | 161 static double max_touch_move_in_pixels_for_click_; |
155 static double min_distance_for_pinch_scroll_in_pixels_; | 162 static double min_distance_for_pinch_scroll_in_pixels_; |
156 static double min_flick_speed_squared_; | 163 static double min_flick_speed_squared_; |
157 static double min_pinch_update_distance_in_pixels_; | 164 static double min_pinch_update_distance_in_pixels_; |
158 static double min_rail_break_velocity_; | 165 static double min_rail_break_velocity_; |
159 static double min_scroll_delta_squared_; | 166 static double min_scroll_delta_squared_; |
160 static double min_swipe_speed_; | 167 static double min_swipe_speed_; |
161 static double min_touch_down_duration_in_seconds_for_click_; | 168 static double min_touch_down_duration_in_seconds_for_click_; |
162 static int points_buffered_for_velocity_; | 169 static int points_buffered_for_velocity_; |
163 static double rail_break_proportion_; | 170 static double rail_break_proportion_; |
164 static double rail_start_proportion_; | 171 static double rail_start_proportion_; |
165 | 172 |
166 DISALLOW_COPY_AND_ASSIGN(GestureConfiguration); | 173 DISALLOW_COPY_AND_ASSIGN(GestureConfiguration); |
167 }; | 174 }; |
168 | 175 |
169 } // namespace ui | 176 } // namespace ui |
170 | 177 |
171 #endif // UI_BASE_GESTURES_GESTURE_CONFIGURATION_H_ | 178 #endif // UI_BASE_GESTURES_GESTURE_CONFIGURATION_H_ |
OLD | NEW |