| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/android/overscroll_refresh.h" | 5 #include "ui/android/overscroll_refresh.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 | 8 |
| 9 namespace content { | 9 namespace ui { |
| 10 namespace { | 10 namespace { |
| 11 | 11 |
| 12 // Experimentally determined constant used to allow activation even if touch | 12 // Experimentally determined constant used to allow activation even if touch |
| 13 // release results in a small upward fling (quite common during a slow scroll). | 13 // release results in a small upward fling (quite common during a slow scroll). |
| 14 const float kMinFlingVelocityForActivation = -500.f; | 14 const float kMinFlingVelocityForActivation = -500.f; |
| 15 | 15 |
| 16 } // namespace | 16 } // namespace |
| 17 | 17 |
| 18 OverscrollRefresh::OverscrollRefresh(OverscrollRefreshHandler* handler) | 18 OverscrollRefresh::OverscrollRefresh(OverscrollRefreshHandler* handler) |
| 19 : scrolled_to_top_(true), | 19 : scrolled_to_top_(true), |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 scrolled_to_top_ = content_scroll_offset.y() == 0; | 94 scrolled_to_top_ = content_scroll_offset.y() == 0; |
| 95 overflow_y_hidden_ = root_overflow_y_hidden; | 95 overflow_y_hidden_ = root_overflow_y_hidden; |
| 96 } | 96 } |
| 97 | 97 |
| 98 void OverscrollRefresh::Release(bool allow_refresh) { | 98 void OverscrollRefresh::Release(bool allow_refresh) { |
| 99 if (scroll_consumption_state_ == ENABLED) | 99 if (scroll_consumption_state_ == ENABLED) |
| 100 handler_->PullRelease(allow_refresh); | 100 handler_->PullRelease(allow_refresh); |
| 101 scroll_consumption_state_ = DISABLED; | 101 scroll_consumption_state_ = DISABLED; |
| 102 } | 102 } |
| 103 | 103 |
| 104 } // namespace content | 104 } // namespace ui |
| OLD | NEW |