| 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 #ifndef UI_EVENTS_GESTURE_DETECTION_GESTURE_CONFIGURATION_H_ | 5 #ifndef UI_EVENTS_GESTURE_DETECTION_GESTURE_CONFIGURATION_H_ |
| 6 #define UI_EVENTS_GESTURE_DETECTION_GESTURE_CONFIGURATION_H_ | 6 #define UI_EVENTS_GESTURE_DETECTION_GESTURE_CONFIGURATION_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
| 10 #include "ui/events/gesture_detection/gesture_detection_export.h" | 10 #include "ui/events/gesture_detection/gesture_detection_export.h" |
| 11 #include "ui/events/gesture_detection/velocity_tracker.h" | 11 #include "ui/events/gesture_detection/velocity_tracker.h" |
| 12 | 12 |
| 13 namespace ui { | 13 namespace ui { |
| 14 | 14 |
| 15 class GESTURE_DETECTION_EXPORT GestureConfiguration { | 15 class GESTURE_DETECTION_EXPORT GestureConfiguration { |
| 16 public: | 16 public: |
| 17 // Returns the singleton GestureConfiguration. | 17 // Returns the singleton GestureConfiguration. |
| 18 static GestureConfiguration* GetInstance(); | 18 static GestureConfiguration* GetInstance(); |
| 19 | 19 |
| 20 // Ordered alphabetically ignoring underscores. | 20 // Ordered alphabetically ignoring underscores. |
| 21 float default_radius() const { return default_radius_; } | 21 float default_radius() const { return default_radius_; } |
| 22 void set_default_radius(float radius) { | 22 void set_default_radius(float radius) { |
| 23 default_radius_ = radius; | 23 default_radius_ = radius; |
| 24 min_scaling_touch_major_ = default_radius_ * 2; | 24 min_scaling_touch_major_ = default_radius_ * 2; |
| 25 min_gesture_bounds_length_ = default_radius_; | 25 min_gesture_bounds_length_ = default_radius_; |
| 26 } | 26 } |
| 27 bool double_tap_enabled() const { return double_tap_enabled_; } |
| 28 void set_double_tap_enabled(bool enabled) { double_tap_enabled_ = enabled; } |
| 27 int double_tap_timeout_in_ms() const { return double_tap_timeout_in_ms_; } | 29 int double_tap_timeout_in_ms() const { return double_tap_timeout_in_ms_; } |
| 28 int fling_max_cancel_to_down_time_in_ms() const { | 30 int fling_max_cancel_to_down_time_in_ms() const { |
| 29 return fling_max_cancel_to_down_time_in_ms_; | 31 return fling_max_cancel_to_down_time_in_ms_; |
| 30 } | 32 } |
| 31 void set_fling_max_cancel_to_down_time_in_ms(int val) { | 33 void set_fling_max_cancel_to_down_time_in_ms(int val) { |
| 32 fling_max_cancel_to_down_time_in_ms_ = val; | 34 fling_max_cancel_to_down_time_in_ms_ = val; |
| 33 } | 35 } |
| 34 int fling_max_tap_gap_time_in_ms() const { | 36 int fling_max_tap_gap_time_in_ms() const { |
| 35 return fling_max_tap_gap_time_in_ms_; | 37 return fling_max_tap_gap_time_in_ms_; |
| 36 } | 38 } |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 void set_span_slop(float val) { span_slop_ = val; } | 180 void set_span_slop(float val) { span_slop_ = val; } |
| 179 | 181 |
| 180 private: | 182 private: |
| 181 // These are listed in alphabetical order ignoring underscores. | 183 // These are listed in alphabetical order ignoring underscores. |
| 182 // NOTE: Adding new configuration parameters requires initializing | 184 // NOTE: Adding new configuration parameters requires initializing |
| 183 // corresponding entries in aura_test_base.cc's SetUp(). | 185 // corresponding entries in aura_test_base.cc's SetUp(). |
| 184 | 186 |
| 185 // The default touch radius length used when the only information given | 187 // The default touch radius length used when the only information given |
| 186 // by the device is the touch center. | 188 // by the device is the touch center. |
| 187 float default_radius_; | 189 float default_radius_; |
| 190 |
| 191 bool double_tap_enabled_; |
| 188 int double_tap_timeout_in_ms_; | 192 int double_tap_timeout_in_ms_; |
| 193 |
| 189 // Maximum time between a GestureFlingCancel and a mousedown such that the | 194 // Maximum time between a GestureFlingCancel and a mousedown such that the |
| 190 // mousedown is considered associated with the cancel event. | 195 // mousedown is considered associated with the cancel event. |
| 191 int fling_max_cancel_to_down_time_in_ms_; | 196 int fling_max_cancel_to_down_time_in_ms_; |
| 192 | 197 |
| 193 // Maxium time between a mousedown/mouseup pair that is considered to be a | 198 // Maxium time between a mousedown/mouseup pair that is considered to be a |
| 194 // suppressable tap. | 199 // suppressable tap. |
| 195 int fling_max_tap_gap_time_in_ms_; | 200 int fling_max_tap_gap_time_in_ms_; |
| 196 bool gesture_begin_end_types_enabled_; | 201 bool gesture_begin_end_types_enabled_; |
| 197 int long_press_time_in_ms_; | 202 int long_press_time_in_ms_; |
| 198 float max_distance_between_taps_for_double_tap_; | 203 float max_distance_between_taps_for_double_tap_; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 227 bool two_finger_tap_enabled_; | 232 bool two_finger_tap_enabled_; |
| 228 VelocityTracker::Strategy velocity_tracker_strategy_; | 233 VelocityTracker::Strategy velocity_tracker_strategy_; |
| 229 | 234 |
| 230 friend struct DefaultSingletonTraits<GestureConfiguration>; | 235 friend struct DefaultSingletonTraits<GestureConfiguration>; |
| 231 DISALLOW_COPY_AND_ASSIGN(GestureConfiguration); | 236 DISALLOW_COPY_AND_ASSIGN(GestureConfiguration); |
| 232 }; | 237 }; |
| 233 | 238 |
| 234 } // namespace ui | 239 } // namespace ui |
| 235 | 240 |
| 236 #endif // UI_EVENTS_GESTURE_DETECTION_GESTURE_CONFIGURATION_H_ | 241 #endif // UI_EVENTS_GESTURE_DETECTION_GESTURE_CONFIGURATION_H_ |
| OLD | NEW |