| Index: content/browser/renderer_host/overscroll_controller.cc
|
| diff --git a/content/browser/renderer_host/overscroll_controller.cc b/content/browser/renderer_host/overscroll_controller.cc
|
| index bf509d6a117018bf9c25b49fe9cb0d2053d01fc9..688ff5cf4cfd888aa00eea93475cf441d0c931e7 100644
|
| --- a/content/browser/renderer_host/overscroll_controller.cc
|
| +++ b/content/browser/renderer_host/overscroll_controller.cc
|
| @@ -1,5 +1,3 @@
|
| -
|
| -
|
| // Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
| @@ -281,14 +279,16 @@ void OverscrollController::ProcessEventForOverscroll(
|
| }
|
|
|
| void OverscrollController::ProcessOverscroll(float delta_x, float delta_y) {
|
| - if (scroll_state_ == STATE_CONTENT_SCROLLING)
|
| - return;
|
| - overscroll_delta_x_ += delta_x;
|
| + if (scroll_state_ != STATE_CONTENT_SCROLLING)
|
| + overscroll_delta_x_ += delta_x;
|
| overscroll_delta_y_ += delta_y;
|
|
|
| - float threshold = GetOverscrollConfig(OVERSCROLL_CONFIG_MIN_THRESHOLD_START);
|
| - if (fabs(overscroll_delta_x_) < threshold &&
|
| - fabs(overscroll_delta_y_) < threshold) {
|
| + float horiz_threshold = GetOverscrollConfig(
|
| + OVERSCROLL_CONFIG_HORIZ_THRESHOLD_START);
|
| + float vert_threshold = GetOverscrollConfig(
|
| + OVERSCROLL_CONFIG_VERT_THRESHOLD_START);
|
| + if (fabs(overscroll_delta_x_) <= horiz_threshold &&
|
| + fabs(overscroll_delta_y_) <= vert_threshold) {
|
| SetOverscrollMode(OVERSCROLL_NONE);
|
| return;
|
| }
|
| @@ -316,21 +316,21 @@ void OverscrollController::ProcessOverscroll(float delta_x, float delta_y) {
|
| // Do not include the threshold amount when sending the deltas to the
|
| // delegate.
|
| float delegate_delta_x = overscroll_delta_x_;
|
| - if (fabs(delegate_delta_x) > threshold) {
|
| + if (fabs(delegate_delta_x) > horiz_threshold) {
|
| if (delegate_delta_x < 0)
|
| - delegate_delta_x += threshold;
|
| + delegate_delta_x += horiz_threshold;
|
| else
|
| - delegate_delta_x -= threshold;
|
| + delegate_delta_x -= horiz_threshold;
|
| } else {
|
| delegate_delta_x = 0.f;
|
| }
|
|
|
| float delegate_delta_y = overscroll_delta_y_;
|
| - if (fabs(delegate_delta_y) > threshold) {
|
| + if (fabs(delegate_delta_y) > vert_threshold) {
|
| if (delegate_delta_y < 0)
|
| - delegate_delta_y += threshold;
|
| + delegate_delta_y += vert_threshold;
|
| else
|
| - delegate_delta_y -= threshold;
|
| + delegate_delta_y -= vert_threshold;
|
| } else {
|
| delegate_delta_y = 0.f;
|
| }
|
|
|