Commit a2349a8f authored by lanwei's avatar lanwei Committed by Commit bot

Remove unsupported parameters by the unified gesture detector from Gesture Configuration.

There are some parameters in the Gesture Configuration which are
no longer used for unified gesture detector:
max_radius_;
min_flick_speed_squared_
min_rail_break_velocity_
min_scroll_delta_squared_
min_touch_down_duration_in_seconds_for_click_
rail_break_proportion_
rail_start_proportion_
scroll_prediction_seconds_
points_buffered_for_velocity_

BUG=380131

Review URL: https://codereview.chromium.org/570633002

Cr-Commit-Position: refs/heads/master@{#294975}
parent a7e3c07f
...@@ -635,8 +635,6 @@ class GestureRecognizerTest : public AuraTestBase, ...@@ -635,8 +635,6 @@ class GestureRecognizerTest : public AuraTestBase,
virtual void SetUp() OVERRIDE { virtual void SetUp() OVERRIDE {
AuraTestBase::SetUp(); AuraTestBase::SetUp();
ui::GestureConfiguration::set_min_touch_down_duration_in_seconds_for_click(
0.001);
ui::GestureConfiguration::set_show_press_delay_in_ms(2); ui::GestureConfiguration::set_show_press_delay_in_ms(2);
ui::GestureConfiguration::set_long_press_time_in_seconds(0.003); ui::GestureConfiguration::set_long_press_time_in_seconds(0.003);
} }
...@@ -1008,9 +1006,7 @@ TEST_F(GestureRecognizerTest, GestureEventScroll) { ...@@ -1008,9 +1006,7 @@ TEST_F(GestureRecognizerTest, GestureEventScroll) {
// Check that predicted scroll update positions are correct. // Check that predicted scroll update positions are correct.
TEST_F(GestureRecognizerTest, GestureEventScrollPrediction) { TEST_F(GestureRecognizerTest, GestureEventScrollPrediction) {
const double prediction_interval = 0.03; // We'll start by moving the touch point by (5, 5). We want all of that
ui::GestureConfiguration::set_scroll_prediction_seconds(prediction_interval);
// We'll start by moving the touch point by (5, 5). We want all of that
// distance to be consumed by the slop, so we set the slop radius to // distance to be consumed by the slop, so we set the slop radius to
// sqrt(5 * 5 + 5 * 5). // sqrt(5 * 5 + 5 * 5).
ui::GestureConfiguration::set_max_touch_move_in_pixels_for_click( ui::GestureConfiguration::set_max_touch_move_in_pixels_for_click(
...@@ -1166,10 +1162,16 @@ TEST_F(GestureRecognizerTest, GestureEventHorizontalRailFling) { ...@@ -1166,10 +1162,16 @@ TEST_F(GestureRecognizerTest, GestureEventHorizontalRailFling) {
EXPECT_FLOAT_EQ(20, delegate->scroll_x()); EXPECT_FLOAT_EQ(20, delegate->scroll_x());
// Get a high x velocity, while still staying on the rail // Get a high x velocity, while still staying on the rail
tes.SendScrollEvents(event_processor(), 1, 1, const int kScrollAmount = 8;
100, 10, kTouchId, 1, tes.SendScrollEvents(event_processor(),
ui::GestureConfiguration::points_buffered_for_velocity(), 1,
delegate.get()); 1,
100,
10,
kTouchId,
1,
kScrollAmount,
delegate.get());
delegate->Reset(); delegate->Reset();
ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201),
...@@ -1211,9 +1213,15 @@ TEST_F(GestureRecognizerTest, GestureEventVerticalRailFling) { ...@@ -1211,9 +1213,15 @@ TEST_F(GestureRecognizerTest, GestureEventVerticalRailFling) {
EXPECT_EQ(0, delegate->scroll_velocity_x()); EXPECT_EQ(0, delegate->scroll_velocity_x());
// Get a high y velocity, while still staying on the rail // Get a high y velocity, while still staying on the rail
tes.SendScrollEvents(event_processor(), 1, 6, const int kScrollAmount = 8;
10, 100, kTouchId, 1, tes.SendScrollEvents(event_processor(),
ui::GestureConfiguration::points_buffered_for_velocity(), 1,
6,
10,
100,
kTouchId,
1,
kScrollAmount,
delegate.get()); delegate.get());
EXPECT_EQ(0, delegate->scroll_velocity_x()); EXPECT_EQ(0, delegate->scroll_velocity_x());
...@@ -1250,9 +1258,15 @@ TEST_F(GestureRecognizerTest, GestureEventNonRailFling) { ...@@ -1250,9 +1258,15 @@ TEST_F(GestureRecognizerTest, GestureEventNonRailFling) {
EXPECT_EQ(50, delegate->scroll_y()); EXPECT_EQ(50, delegate->scroll_y());
EXPECT_EQ(50, delegate->scroll_x()); EXPECT_EQ(50, delegate->scroll_x());
tes.SendScrollEvents(event_processor(), 1, 1, const int kScrollAmount = 8;
10, 100, kTouchId, 1, tes.SendScrollEvents(event_processor(),
ui::GestureConfiguration::points_buffered_for_velocity(), 1,
1,
10,
100,
kTouchId,
1,
kScrollAmount,
delegate.get()); delegate.get());
delegate->Reset(); delegate->Reset();
...@@ -1479,9 +1493,15 @@ TEST_F(GestureRecognizerTest, GestureEventHorizontalRailScroll) { ...@@ -1479,9 +1493,15 @@ TEST_F(GestureRecognizerTest, GestureEventHorizontalRailScroll) {
// Send enough information that a velocity can be calculated for the gesture, // Send enough information that a velocity can be calculated for the gesture,
// and we can break the rail // and we can break the rail
tes.SendScrollEvents(event_processor(), 1, 1, const int kScrollAmount = 8;
6, 100, kTouchId, 1, tes.SendScrollEvents(event_processor(),
ui::GestureConfiguration::points_buffered_for_velocity(), 1,
1,
6,
100,
kTouchId,
1,
kScrollAmount,
delegate.get()); delegate.get());
tes.SendScrollEvent(event_processor(), 5, 0, kTouchId, delegate.get()); tes.SendScrollEvent(event_processor(), 5, 0, kTouchId, delegate.get());
...@@ -1529,9 +1549,15 @@ TEST_F(GestureRecognizerTest, GestureEventVerticalRailScroll) { ...@@ -1529,9 +1549,15 @@ TEST_F(GestureRecognizerTest, GestureEventVerticalRailScroll) {
// Send enough information that a velocity can be calculated for the gesture, // Send enough information that a velocity can be calculated for the gesture,
// and we can break the rail // and we can break the rail
tes.SendScrollEvents(event_processor(), 1, 6, const int kScrollAmount = 8;
100, 1, kTouchId, 1, tes.SendScrollEvents(event_processor(),
ui::GestureConfiguration::points_buffered_for_velocity(), 1,
6,
100,
1,
kTouchId,
1,
kScrollAmount,
delegate.get()); delegate.get());
tes.SendScrollEvent(event_processor(), 0, 5, kTouchId, delegate.get()); tes.SendScrollEvent(event_processor(), 0, 5, kTouchId, delegate.get());
...@@ -3435,7 +3461,6 @@ TEST_F(GestureRecognizerTest, BoundingBoxRadiusChange) { ...@@ -3435,7 +3461,6 @@ TEST_F(GestureRecognizerTest, BoundingBoxRadiusChange) {
// In particular, fix for http;//crbug.com/150573. // In particular, fix for http;//crbug.com/150573.
TEST_F(GestureRecognizerTest, NoDriftInScroll) { TEST_F(GestureRecognizerTest, NoDriftInScroll) {
ui::GestureConfiguration::set_max_touch_move_in_pixels_for_click(3); ui::GestureConfiguration::set_max_touch_move_in_pixels_for_click(3);
ui::GestureConfiguration::set_min_scroll_delta_squared(9);
scoped_ptr<GestureEventConsumeDelegate> delegate( scoped_ptr<GestureEventConsumeDelegate> delegate(
new GestureEventConsumeDelegate()); new GestureEventConsumeDelegate());
const int kWindowWidth = 234; const int kWindowWidth = 234;
......
...@@ -49,16 +49,7 @@ void AuraTestBase::SetUp() { ...@@ -49,16 +49,7 @@ void AuraTestBase::SetUp() {
ui::GestureConfiguration::set_max_touch_move_in_pixels_for_click(5); ui::GestureConfiguration::set_max_touch_move_in_pixels_for_click(5);
ui::GestureConfiguration::set_max_distance_between_taps_for_double_tap(20); ui::GestureConfiguration::set_max_distance_between_taps_for_double_tap(20);
ui::GestureConfiguration::set_min_distance_for_pinch_scroll_in_pixels(20); ui::GestureConfiguration::set_min_distance_for_pinch_scroll_in_pixels(20);
ui::GestureConfiguration::set_min_flick_speed_squared(550.f * 550.f);
ui::GestureConfiguration::set_min_pinch_update_distance_in_pixels(5); ui::GestureConfiguration::set_min_pinch_update_distance_in_pixels(5);
ui::GestureConfiguration::set_min_rail_break_velocity(200);
ui::GestureConfiguration::set_min_scroll_delta_squared(5 * 5);
ui::GestureConfiguration::
set_min_touch_down_duration_in_seconds_for_click(0.0005);
ui::GestureConfiguration::set_points_buffered_for_velocity(10);
ui::GestureConfiguration::set_rail_break_proportion(15);
ui::GestureConfiguration::set_rail_start_proportion(2);
ui::GestureConfiguration::set_scroll_prediction_seconds(0);
ui::GestureConfiguration::set_default_radius(0); ui::GestureConfiguration::set_default_radius(0);
ui::GestureConfiguration::set_fling_acceleration_curve_coefficients( ui::GestureConfiguration::set_fling_acceleration_curve_coefficients(
0, 0.0166667f); 0, 0.0166667f);
......
...@@ -14,7 +14,6 @@ int GestureConfiguration::tab_scrub_activation_delay_in_ms_ = 200; ...@@ -14,7 +14,6 @@ int GestureConfiguration::tab_scrub_activation_delay_in_ms_ = 200;
double GestureConfiguration::long_press_time_in_seconds_ = 1.0; double GestureConfiguration::long_press_time_in_seconds_ = 1.0;
double GestureConfiguration::semi_long_press_time_in_seconds_ = 0.4; double GestureConfiguration::semi_long_press_time_in_seconds_ = 0.4;
double GestureConfiguration::max_distance_for_two_finger_tap_in_pixels_ = 300; double GestureConfiguration::max_distance_for_two_finger_tap_in_pixels_ = 300;
int GestureConfiguration::max_radius_ = 100;
double GestureConfiguration::max_seconds_between_double_click_ = 0.7; double GestureConfiguration::max_seconds_between_double_click_ = 0.7;
double double
GestureConfiguration::max_separation_for_gesture_touches_in_pixels_ = 150; GestureConfiguration::max_separation_for_gesture_touches_in_pixels_ = 150;
...@@ -24,25 +23,13 @@ double ...@@ -24,25 +23,13 @@ double
double GestureConfiguration::max_touch_move_in_pixels_for_click_ = 15; double GestureConfiguration::max_touch_move_in_pixels_for_click_ = 15;
double GestureConfiguration::max_distance_between_taps_for_double_tap_ = 20; double GestureConfiguration::max_distance_between_taps_for_double_tap_ = 20;
double GestureConfiguration::min_distance_for_pinch_scroll_in_pixels_ = 20; double GestureConfiguration::min_distance_for_pinch_scroll_in_pixels_ = 20;
double GestureConfiguration::min_flick_speed_squared_ = 550.f * 550.f;
double GestureConfiguration::min_pinch_update_distance_in_pixels_ = 5; double GestureConfiguration::min_pinch_update_distance_in_pixels_ = 5;
double GestureConfiguration::min_rail_break_velocity_ = 200;
double GestureConfiguration::min_scroll_delta_squared_ = 4 * 4;
float GestureConfiguration::min_scroll_velocity_ = 30.0f; float GestureConfiguration::min_scroll_velocity_ = 30.0f;
double GestureConfiguration::min_swipe_speed_ = 20; double GestureConfiguration::min_swipe_speed_ = 20;
double GestureConfiguration::scroll_prediction_seconds_ = 0.03;
double
GestureConfiguration::min_touch_down_duration_in_seconds_for_click_ = 0.01;
// If this is too small, we currently can get single finger pinch zoom. See // If this is too small, we currently can get single finger pinch zoom. See
// crbug.com/357237 for details. // crbug.com/357237 for details.
int GestureConfiguration::min_scaling_span_in_pixels_ = 125; int GestureConfiguration::min_scaling_span_in_pixels_ = 125;
// The number of points used in the linear regression which determines
// touch velocity. Velocity is reported for 2 or more touch move events.
int GestureConfiguration::points_buffered_for_velocity_ = 8;
double GestureConfiguration::rail_break_proportion_ = 15;
double GestureConfiguration::rail_start_proportion_ = 2;
int GestureConfiguration::show_press_delay_in_ms_ = 150; int GestureConfiguration::show_press_delay_in_ms_ = 150;
// TODO(jdduke): Disable and remove entirely when issues with intermittent // TODO(jdduke): Disable and remove entirely when issues with intermittent
......
...@@ -50,9 +50,6 @@ class EVENTS_BASE_EXPORT GestureConfiguration { ...@@ -50,9 +50,6 @@ class EVENTS_BASE_EXPORT GestureConfiguration {
static void set_max_distance_for_two_finger_tap_in_pixels(double val) { static void set_max_distance_for_two_finger_tap_in_pixels(double val) {
max_distance_for_two_finger_tap_in_pixels_ = val; max_distance_for_two_finger_tap_in_pixels_ = val;
} }
static int max_radius() {
return max_radius_;
}
static void set_long_press_time_in_seconds(double val) { static void set_long_press_time_in_seconds(double val) {
long_press_time_in_seconds_ = val; long_press_time_in_seconds_ = val;
} }
...@@ -101,30 +98,12 @@ class EVENTS_BASE_EXPORT GestureConfiguration { ...@@ -101,30 +98,12 @@ class EVENTS_BASE_EXPORT GestureConfiguration {
static void set_min_distance_for_pinch_scroll_in_pixels(double val) { static void set_min_distance_for_pinch_scroll_in_pixels(double val) {
min_distance_for_pinch_scroll_in_pixels_ = val; min_distance_for_pinch_scroll_in_pixels_ = val;
} }
static double min_flick_speed_squared() {
return min_flick_speed_squared_;
}
static void set_min_flick_speed_squared(double val) {
min_flick_speed_squared_ = val;
}
static double min_pinch_update_distance_in_pixels() { static double min_pinch_update_distance_in_pixels() {
return min_pinch_update_distance_in_pixels_; return min_pinch_update_distance_in_pixels_;
} }
static void set_min_pinch_update_distance_in_pixels(double val) { static void set_min_pinch_update_distance_in_pixels(double val) {
min_pinch_update_distance_in_pixels_ = val; min_pinch_update_distance_in_pixels_ = val;
} }
static double min_rail_break_velocity() {
return min_rail_break_velocity_;
}
static void set_min_rail_break_velocity(double val) {
min_rail_break_velocity_ = val;
}
static double min_scroll_delta_squared() {
return min_scroll_delta_squared_;
}
static void set_min_scroll_delta_squared(double val) {
min_scroll_delta_squared_ = val;
}
static float min_scroll_velocity() { static float min_scroll_velocity() {
return min_scroll_velocity_; return min_scroll_velocity_;
} }
...@@ -137,45 +116,12 @@ class EVENTS_BASE_EXPORT GestureConfiguration { ...@@ -137,45 +116,12 @@ class EVENTS_BASE_EXPORT GestureConfiguration {
static void set_min_swipe_speed(double val) { static void set_min_swipe_speed(double val) {
min_swipe_speed_ = val; min_swipe_speed_ = val;
} }
static double min_touch_down_duration_in_seconds_for_click() {
return min_touch_down_duration_in_seconds_for_click_;
}
static void set_min_touch_down_duration_in_seconds_for_click(double val) {
min_touch_down_duration_in_seconds_for_click_ = val;
}
static int min_scaling_span_in_pixels() { static int min_scaling_span_in_pixels() {
return min_scaling_span_in_pixels_; return min_scaling_span_in_pixels_;
}; };
static void set_min_scaling_span_in_pixels(int val) { static void set_min_scaling_span_in_pixels(int val) {
min_scaling_span_in_pixels_ = val; min_scaling_span_in_pixels_ = val;
} }
static int points_buffered_for_velocity() {
return points_buffered_for_velocity_;
}
static void set_points_buffered_for_velocity(int val) {
points_buffered_for_velocity_ = val;
}
static double rail_break_proportion() {
return rail_break_proportion_;
}
static void set_rail_break_proportion(double val) {
rail_break_proportion_ = val;
}
static double rail_start_proportion() {
return rail_start_proportion_;
}
static void set_rail_start_proportion(double val) {
rail_start_proportion_ = val;
}
static double scroll_prediction_seconds() {
return scroll_prediction_seconds_;
}
static void set_scroll_prediction_seconds(double val) {
scroll_prediction_seconds_ = val;
}
static int show_press_delay_in_ms() { static int show_press_delay_in_ms() {
return show_press_delay_in_ms_; return show_press_delay_in_ms_;
} }
...@@ -222,10 +168,6 @@ class EVENTS_BASE_EXPORT GestureConfiguration { ...@@ -222,10 +168,6 @@ class EVENTS_BASE_EXPORT GestureConfiguration {
// recognize a two finger tap. // recognize a two finger tap.
static double max_distance_for_two_finger_tap_in_pixels_; static double max_distance_for_two_finger_tap_in_pixels_;
// The maximum allowed size for the radius of a touch region used in
// forming an ET_GESTURE_TAP event.
static int max_radius_;
// Maximum time between a GestureFlingCancel and a mousedown such that the // Maximum time between a GestureFlingCancel and a mousedown such that the
// mousedown is considered associated with the cancel event. // mousedown is considered associated with the cancel event.
static int fling_max_cancel_to_down_time_in_ms_; static int fling_max_cancel_to_down_time_in_ms_;
...@@ -243,22 +185,13 @@ class EVENTS_BASE_EXPORT GestureConfiguration { ...@@ -243,22 +185,13 @@ class EVENTS_BASE_EXPORT GestureConfiguration {
static double max_touch_move_in_pixels_for_click_; static double max_touch_move_in_pixels_for_click_;
static double max_distance_between_taps_for_double_tap_; static double max_distance_between_taps_for_double_tap_;
static double min_distance_for_pinch_scroll_in_pixels_; static double min_distance_for_pinch_scroll_in_pixels_;
static double min_flick_speed_squared_;
// Only used with --compensate-for-unstable-pinch-zoom. // Only used with --compensate-for-unstable-pinch-zoom.
static double min_pinch_update_distance_in_pixels_; static double min_pinch_update_distance_in_pixels_;
static double min_rail_break_velocity_;
static double min_scroll_delta_squared_;
static float min_scroll_velocity_; static float min_scroll_velocity_;
static double min_swipe_speed_; static double min_swipe_speed_;
static double min_touch_down_duration_in_seconds_for_click_;
static int min_scaling_span_in_pixels_; static int min_scaling_span_in_pixels_;
static int points_buffered_for_velocity_;
static double rail_break_proportion_;
static double rail_start_proportion_;
static double scroll_prediction_seconds_;
static int show_press_delay_in_ms_; static int show_press_delay_in_ms_;
static int scroll_debounce_interval_in_ms_; static int scroll_debounce_interval_in_ms_;
static float fling_acceleration_curve_coefficients_[NumAccelParams]; static float fling_acceleration_curve_coefficients_[NumAccelParams];
static float fling_velocity_cap_; static float fling_velocity_cap_;
// TODO(davemoore): Move into chrome/browser/ui. // TODO(davemoore): Move into chrome/browser/ui.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment