Commit 189b3802 authored by Jinsuk Kim's avatar Jinsuk Kim Committed by Commit Bot

Android: Fix the aggressive pull-to-refresh triggering

https://crrev.com/c/1547547 inadvertently increased the triggering
condition for pull-to-refresh by 33%, hence causing the action to
occur when not expected by users. This CL reverts the related change.

Bug: 974823
Change-Id: I76374a6c6af187de719d40c03075f7883bc866da
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1669910Reviewed-by: default avatarTheresa <twellington@chromium.org>
Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
Commit-Queue: Jinsuk Kim <jinsukkim@chromium.org>
Cr-Commit-Position: refs/heads/master@{#671450}
parent 0756c5ab
......@@ -73,7 +73,8 @@ void OverscrollRefresh::OnOverscrolled(const cc::OverscrollBehavior& behavior) {
float ydelta = cumulative_scroll_.y();
float xdelta = cumulative_scroll_.x();
bool in_y_direction = std::abs(ydelta) * kWeightAngle30 > std::abs(xdelta);
bool in_y_direction = std::abs(ydelta) > std::abs(xdelta);
bool in_x_direction = std::abs(ydelta) * kWeightAngle30 < std::abs(xdelta);
OverscrollAction type = OverscrollAction::NONE;
bool navigate_forward = false;
if (ydelta > 0 && in_y_direction) {
......@@ -84,7 +85,7 @@ void OverscrollRefresh::OnOverscrolled(const cc::OverscrollBehavior& behavior) {
return;
}
type = OverscrollAction::PULL_TO_REFRESH;
} else if (!in_y_direction &&
} else if (in_x_direction &&
(scroll_begin_x_ < edge_width_ ||
viewport_width_ - scroll_begin_x_ < edge_width_)) {
// Swipe-to-navigate. Check overscroll-behavior-x
......
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