diff options
Diffstat (limited to 'ui/base')
-rw-r--r-- | ui/base/gestures/gesture_configuration.cc | 1 | ||||
-rw-r--r-- | ui/base/gestures/gesture_configuration.h | 7 | ||||
-rw-r--r-- | ui/base/gestures/gesture_point.cc | 6 |
3 files changed, 14 insertions, 0 deletions
diff --git a/ui/base/gestures/gesture_configuration.cc b/ui/base/gestures/gesture_configuration.cc index 789b927..65a4576 100644 --- a/ui/base/gestures/gesture_configuration.cc +++ b/ui/base/gestures/gesture_configuration.cc @@ -10,6 +10,7 @@ namespace ui { // associated list of prefs in gesture_prefs_aura.cc. int GestureConfiguration::default_radius_ = 15; double GestureConfiguration::long_press_time_in_seconds_ = 0.5; +int GestureConfiguration::max_radius_ = 100; double GestureConfiguration::max_seconds_between_double_click_ = 0.7; double GestureConfiguration::max_separation_for_gesture_touches_in_pixels_ = 150; diff --git a/ui/base/gestures/gesture_configuration.h b/ui/base/gestures/gesture_configuration.h index 3914629..f491ccd 100644 --- a/ui/base/gestures/gesture_configuration.h +++ b/ui/base/gestures/gesture_configuration.h @@ -25,6 +25,9 @@ class UI_EXPORT GestureConfiguration { static double long_press_time_in_seconds() { return long_press_time_in_seconds_; } + static int max_radius() { + return max_radius_; + } static void set_long_press_time_in_seconds(double val) { long_press_time_in_seconds_ = val; } @@ -128,6 +131,10 @@ class UI_EXPORT GestureConfiguration { // by the device is the touch center. static int default_radius_; + // The maximum allowed size for the radius of a touch region used in + // forming an ET_GESTURE_TAP event. + static int max_radius_; + static double long_press_time_in_seconds_; static double max_seconds_between_double_click_; static double max_separation_for_gesture_touches_in_pixels_; diff --git a/ui/base/gestures/gesture_point.cc b/ui/base/gestures/gesture_point.cc index 5b8fe5e..5a6537f 100644 --- a/ui/base/gestures/gesture_point.cc +++ b/ui/base/gestures/gesture_point.cc @@ -178,6 +178,12 @@ bool GesturePoint::IsOverMinFlickSpeed() { void GesturePoint::UpdateEnclosingRectangle(const TouchEvent& event) { int radius; + // Ignore this TouchEvent if it has a radius larger than the maximum + // allowed radius size. + if (event.RadiusX() > GestureConfiguration::max_radius() || + event.RadiusY() > GestureConfiguration::max_radius()) + return; + // If the device provides at least one of the radius values, take the larger // of the two and use this as both the x radius and the y radius of the // touch region. Otherwise use the default radius value. |