diff options
Diffstat (limited to 'ui/events/gesture_detection')
4 files changed, 27 insertions, 0 deletions
diff --git a/ui/events/gesture_detection/gesture_configuration.cc b/ui/events/gesture_detection/gesture_configuration.cc index 3e5ae29..c3d3d2f 100644 --- a/ui/events/gesture_detection/gesture_configuration.cc +++ b/ui/events/gesture_detection/gesture_configuration.cc @@ -28,6 +28,8 @@ GestureConfiguration::GestureConfiguration() : default_radius_(25), double_tap_enabled_(false), double_tap_timeout_in_ms_(400), + fling_touchpad_tap_suppression_enabled_(false), + fling_touchscreen_tap_suppression_enabled_(false), fling_max_cancel_to_down_time_in_ms_(400), fling_max_tap_gap_time_in_ms_(200), gesture_begin_end_types_enabled_(false), diff --git a/ui/events/gesture_detection/gesture_configuration.h b/ui/events/gesture_detection/gesture_configuration.h index 78234a0..6d100c8 100644 --- a/ui/events/gesture_detection/gesture_configuration.h +++ b/ui/events/gesture_detection/gesture_configuration.h @@ -28,6 +28,18 @@ class GESTURE_DETECTION_EXPORT GestureConfiguration { bool double_tap_enabled() const { return double_tap_enabled_; } void set_double_tap_enabled(bool enabled) { double_tap_enabled_ = enabled; } int double_tap_timeout_in_ms() const { return double_tap_timeout_in_ms_; } + bool fling_touchpad_tap_suppression_enabled() const { + return fling_touchpad_tap_suppression_enabled_; + } + void set_fling_touchpad_tap_suppression_enabled(bool enabled) { + fling_touchpad_tap_suppression_enabled_ = enabled; + } + bool fling_touchscreen_tap_suppression_enabled() const { + return fling_touchscreen_tap_suppression_enabled_; + } + void set_fling_touchscreen_tap_suppression_enabled(bool enabled) { + fling_touchscreen_tap_suppression_enabled_ = enabled; + } int fling_max_cancel_to_down_time_in_ms() const { return fling_max_cancel_to_down_time_in_ms_; } @@ -196,6 +208,11 @@ class GESTURE_DETECTION_EXPORT GestureConfiguration { bool double_tap_enabled_; int double_tap_timeout_in_ms_; + // Whether to suppress touchscreen/touchpad taps that occur during a fling ( + // in particular, when such taps cancel the active fling). + bool fling_touchpad_tap_suppression_enabled_; + bool fling_touchscreen_tap_suppression_enabled_; + // Maximum time between a GestureFlingCancel and a mousedown such that the // mousedown is considered associated with the cancel event. int fling_max_cancel_to_down_time_in_ms_; diff --git a/ui/events/gesture_detection/gesture_configuration_android.cc b/ui/events/gesture_detection/gesture_configuration_android.cc index 4922559..4a81915 100644 --- a/ui/events/gesture_detection/gesture_configuration_android.cc +++ b/ui/events/gesture_detection/gesture_configuration_android.cc @@ -52,6 +52,12 @@ class GestureConfigurationAndroid : public GestureConfiguration { ViewConfiguration::GetMinScalingTouchMajorInDips()); set_show_press_delay_in_ms(ViewConfiguration::GetTapTimeoutInMs()); set_span_slop(ViewConfiguration::GetTouchSlopInDips() * 2.f); + set_fling_touchscreen_tap_suppression_enabled(true); + set_fling_touchpad_tap_suppression_enabled(false); + set_fling_max_cancel_to_down_time_in_ms( + ViewConfiguration::GetTapTimeoutInMs()); + set_fling_max_tap_gap_time_in_ms( + ViewConfiguration::GetLongPressTimeoutInMs()); } friend struct DefaultSingletonTraits<GestureConfigurationAndroid>; diff --git a/ui/events/gesture_detection/gesture_configuration_aura.cc b/ui/events/gesture_detection/gesture_configuration_aura.cc index df4bcf4..d7e47c1 100644 --- a/ui/events/gesture_detection/gesture_configuration_aura.cc +++ b/ui/events/gesture_detection/gesture_configuration_aura.cc @@ -36,6 +36,8 @@ class GestureConfigurationAura : public GestureConfiguration { set_span_slop(max_touch_move_in_pixels_for_click() * 2); set_swipe_enabled(true); set_two_finger_tap_enabled(true); + set_fling_touchpad_tap_suppression_enabled(true); + set_fling_touchscreen_tap_suppression_enabled(true); } friend struct DefaultSingletonTraits<GestureConfigurationAura>; |