OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_EVENTS_GESTURES_GESTURE_CONFIGURATION_H_ | 5 #ifndef UI_EVENTS_GESTURES_GESTURE_CONFIGURATION_H_ |
6 #define UI_EVENTS_GESTURES_GESTURE_CONFIGURATION_H_ | 6 #define UI_EVENTS_GESTURES_GESTURE_CONFIGURATION_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "ui/events/events_base_export.h" | 9 #include "ui/events/events_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 EVENTS_BASE_EXPORT GestureConfiguration { | 17 class EVENTS_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 } |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 } | 136 } |
137 static void set_min_swipe_speed(double val) { | 137 static void set_min_swipe_speed(double val) { |
138 min_swipe_speed_ = val; | 138 min_swipe_speed_ = val; |
139 } | 139 } |
140 static double min_touch_down_duration_in_seconds_for_click() { | 140 static double min_touch_down_duration_in_seconds_for_click() { |
141 return min_touch_down_duration_in_seconds_for_click_; | 141 return min_touch_down_duration_in_seconds_for_click_; |
142 } | 142 } |
143 static void set_min_touch_down_duration_in_seconds_for_click(double val) { | 143 static void set_min_touch_down_duration_in_seconds_for_click(double val) { |
144 min_touch_down_duration_in_seconds_for_click_ = val; | 144 min_touch_down_duration_in_seconds_for_click_ = val; |
145 } | 145 } |
146 | |
147 static int min_scaling_span_in_pixels() { | |
148 return min_scaling_span_in_pixels_; | |
149 }; | |
150 | |
151 static void set_min_scaling_span_in_pixels(int val) { | |
152 min_scaling_span_in_pixels_ = val; | |
153 } | |
154 | |
155 static int points_buffered_for_velocity() { | 146 static int points_buffered_for_velocity() { |
156 return points_buffered_for_velocity_; | 147 return points_buffered_for_velocity_; |
157 } | 148 } |
158 static void set_points_buffered_for_velocity(int val) { | 149 static void set_points_buffered_for_velocity(int val) { |
159 points_buffered_for_velocity_ = val; | 150 points_buffered_for_velocity_ = val; |
160 } | 151 } |
161 static double rail_break_proportion() { | 152 static double rail_break_proportion() { |
162 return rail_break_proportion_; | 153 return rail_break_proportion_; |
163 } | 154 } |
164 static void set_rail_break_proportion(double val) { | 155 static void set_rail_break_proportion(double val) { |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 static double max_touch_move_in_pixels_for_click_; | 228 static double max_touch_move_in_pixels_for_click_; |
238 static double max_distance_between_taps_for_double_tap_; | 229 static double max_distance_between_taps_for_double_tap_; |
239 static double min_distance_for_pinch_scroll_in_pixels_; | 230 static double min_distance_for_pinch_scroll_in_pixels_; |
240 static double min_flick_speed_squared_; | 231 static double min_flick_speed_squared_; |
241 static double min_pinch_update_distance_in_pixels_; | 232 static double min_pinch_update_distance_in_pixels_; |
242 static double min_rail_break_velocity_; | 233 static double min_rail_break_velocity_; |
243 static double min_scroll_delta_squared_; | 234 static double min_scroll_delta_squared_; |
244 static float min_scroll_velocity_; | 235 static float min_scroll_velocity_; |
245 static double min_swipe_speed_; | 236 static double min_swipe_speed_; |
246 static double min_touch_down_duration_in_seconds_for_click_; | 237 static double min_touch_down_duration_in_seconds_for_click_; |
247 static int min_scaling_span_in_pixels_; | |
248 static int points_buffered_for_velocity_; | 238 static int points_buffered_for_velocity_; |
249 static double rail_break_proportion_; | 239 static double rail_break_proportion_; |
250 static double rail_start_proportion_; | 240 static double rail_start_proportion_; |
251 static double scroll_prediction_seconds_; | 241 static double scroll_prediction_seconds_; |
252 static int show_press_delay_in_ms_; | 242 static int show_press_delay_in_ms_; |
253 static float fling_acceleration_curve_coefficients_[NumAccelParams]; | 243 static float fling_acceleration_curve_coefficients_[NumAccelParams]; |
254 static float fling_velocity_cap_; | 244 static float fling_velocity_cap_; |
255 // TODO(davemoore): Move into chrome/browser/ui. | 245 // TODO(davemoore): Move into chrome/browser/ui. |
256 static int tab_scrub_activation_delay_in_ms_; | 246 static int tab_scrub_activation_delay_in_ms_; |
257 | 247 |
258 DISALLOW_COPY_AND_ASSIGN(GestureConfiguration); | 248 DISALLOW_COPY_AND_ASSIGN(GestureConfiguration); |
259 }; | 249 }; |
260 | 250 |
261 } // namespace ui | 251 } // namespace ui |
262 | 252 |
263 #endif // UI_EVENTS_GESTURES_GESTURE_CONFIGURATION_H_ | 253 #endif // UI_EVENTS_GESTURES_GESTURE_CONFIGURATION_H_ |
OLD | NEW |