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 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "ui/base/ui_export.h" | 9 #include "ui/base/ui_export.h" |
10 | 10 |
11 namespace ui { | 11 namespace ui { |
12 | 12 |
13 // TODO: Expand this design to support multiple OS configuration | 13 // TODO: Expand this design to support multiple OS configuration |
14 // approaches (windows, chrome, others). This would turn into an | 14 // approaches (windows, chrome, others). This would turn into an |
15 // abstract base class. | 15 // abstract base class. |
16 | 16 |
17 class UI_EXPORT GestureConfiguration { | 17 class UI_EXPORT GestureConfiguration { |
18 public: | 18 public: |
19 // Number of parameters in the array of parameters for the fling acceleration | 19 // Number of parameters in the array of parameters for the fling acceleration |
20 // curve. | 20 // curve. |
21 static const int NumAccelParams = 4; | 21 static const int NumAccelParams = 4; |
22 | 22 |
23 // Ordered alphabetically ignoring underscores, to align with the | 23 // Ordered alphabetically ignoring underscores, to align with the |
24 // associated list of prefs in gesture_prefs_aura.cc. | 24 // associated list of prefs in gesture_prefs_aura.cc. |
25 static int default_radius() { | 25 static int default_radius() { |
26 return default_radius_; | 26 return default_radius_; |
27 } | 27 } |
28 static void set_default_radius(int radius) { default_radius_ = radius; } | 28 static void set_default_radius(int radius) { default_radius_ = radius; } |
| 29 static int fling_max_cancel_to_down_time_in_ms() { |
| 30 return fling_max_cancel_to_down_time_in_ms_; |
| 31 } |
| 32 static void set_fling_max_cancel_to_down_time_in_ms(int val) { |
| 33 fling_max_cancel_to_down_time_in_ms_ = val; |
| 34 } |
| 35 static int fling_max_tap_gap_time_in_ms() { |
| 36 return fling_max_tap_gap_time_in_ms_; |
| 37 } |
| 38 static void set_fling_max_tap_gap_time_in_ms(int val) { |
| 39 fling_max_tap_gap_time_in_ms_ = val; |
| 40 } |
29 static double long_press_time_in_seconds() { | 41 static double long_press_time_in_seconds() { |
30 return long_press_time_in_seconds_; | 42 return long_press_time_in_seconds_; |
31 } | 43 } |
32 static double semi_long_press_time_in_seconds() { | 44 static double semi_long_press_time_in_seconds() { |
33 return semi_long_press_time_in_seconds_; | 45 return semi_long_press_time_in_seconds_; |
34 } | 46 } |
35 static double max_distance_for_two_finger_tap_in_pixels() { | 47 static double max_distance_for_two_finger_tap_in_pixels() { |
36 return max_distance_for_two_finger_tap_in_pixels_; | 48 return max_distance_for_two_finger_tap_in_pixels_; |
37 } | 49 } |
38 static void set_max_distance_for_two_finger_tap_in_pixels(double val) { | 50 static void set_max_distance_for_two_finger_tap_in_pixels(double val) { |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 | 191 |
180 // The maximum allowed distance between two fingers for a two finger tap. If | 192 // The maximum allowed distance between two fingers for a two finger tap. If |
181 // the distance between two fingers is greater than this value, we will not | 193 // the distance between two fingers is greater than this value, we will not |
182 // recognize a two finger tap. | 194 // recognize a two finger tap. |
183 static double max_distance_for_two_finger_tap_in_pixels_; | 195 static double max_distance_for_two_finger_tap_in_pixels_; |
184 | 196 |
185 // The maximum allowed size for the radius of a touch region used in | 197 // The maximum allowed size for the radius of a touch region used in |
186 // forming an ET_GESTURE_TAP event. | 198 // forming an ET_GESTURE_TAP event. |
187 static int max_radius_; | 199 static int max_radius_; |
188 | 200 |
| 201 // Maximum time between a GestureFlingCancel and a mousedown such that the |
| 202 // mousedown is considered associated with the cancel event. |
| 203 static int fling_max_cancel_to_down_time_in_ms_; |
| 204 |
| 205 // Maxium time between a mousedown/mouseup pair that is considered to be a |
| 206 // suppressable tap. |
| 207 static int fling_max_tap_gap_time_in_ms_; |
| 208 |
189 static double long_press_time_in_seconds_; | 209 static double long_press_time_in_seconds_; |
190 static double semi_long_press_time_in_seconds_; | 210 static double semi_long_press_time_in_seconds_; |
191 static double max_seconds_between_double_click_; | 211 static double max_seconds_between_double_click_; |
192 static double max_separation_for_gesture_touches_in_pixels_; | 212 static double max_separation_for_gesture_touches_in_pixels_; |
193 static double max_swipe_deviation_ratio_; | 213 static double max_swipe_deviation_ratio_; |
194 static double max_touch_down_duration_in_seconds_for_click_; | 214 static double max_touch_down_duration_in_seconds_for_click_; |
195 static double max_touch_move_in_pixels_for_click_; | 215 static double max_touch_move_in_pixels_for_click_; |
196 static double max_distance_between_taps_for_double_tap_; | 216 static double max_distance_between_taps_for_double_tap_; |
197 static double min_distance_for_pinch_scroll_in_pixels_; | 217 static double min_distance_for_pinch_scroll_in_pixels_; |
198 static double min_flick_speed_squared_; | 218 static double min_flick_speed_squared_; |
(...skipping 10 matching lines...) Expand all Loading... |
209 static double rail_start_proportion_; | 229 static double rail_start_proportion_; |
210 static float fling_acceleration_curve_coefficients_[NumAccelParams]; | 230 static float fling_acceleration_curve_coefficients_[NumAccelParams]; |
211 static float fling_velocity_cap_; | 231 static float fling_velocity_cap_; |
212 | 232 |
213 DISALLOW_COPY_AND_ASSIGN(GestureConfiguration); | 233 DISALLOW_COPY_AND_ASSIGN(GestureConfiguration); |
214 }; | 234 }; |
215 | 235 |
216 } // namespace ui | 236 } // namespace ui |
217 | 237 |
218 #endif // UI_BASE_GESTURES_GESTURE_CONFIGURATION_H_ | 238 #endif // UI_BASE_GESTURES_GESTURE_CONFIGURATION_H_ |
OLD | NEW |