| 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 "ui/android/overscroll_refresh.h" | 5 #include "ui/android/overscroll_refresh.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "ui/android/overscroll_refresh_handler.h" |
| 8 | 9 |
| 9 namespace ui { | 10 namespace ui { |
| 10 namespace { | 11 namespace { |
| 11 | 12 |
| 12 // Experimentally determined constant used to allow activation even if touch | 13 // Experimentally determined constant used to allow activation even if touch |
| 13 // release results in a small upward fling (quite common during a slow scroll). | 14 // release results in a small upward fling (quite common during a slow scroll). |
| 14 const float kMinFlingVelocityForActivation = -500.f; | 15 const float kMinFlingVelocityForActivation = -500.f; |
| 15 | 16 |
| 16 } // namespace | 17 } // namespace |
| 17 | 18 |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 overflow_y_hidden_ = root_overflow_y_hidden; | 96 overflow_y_hidden_ = root_overflow_y_hidden; |
| 96 } | 97 } |
| 97 | 98 |
| 98 void OverscrollRefresh::Release(bool allow_refresh) { | 99 void OverscrollRefresh::Release(bool allow_refresh) { |
| 99 if (scroll_consumption_state_ == ENABLED) | 100 if (scroll_consumption_state_ == ENABLED) |
| 100 handler_->PullRelease(allow_refresh); | 101 handler_->PullRelease(allow_refresh); |
| 101 scroll_consumption_state_ = DISABLED; | 102 scroll_consumption_state_ = DISABLED; |
| 102 } | 103 } |
| 103 | 104 |
| 104 } // namespace ui | 105 } // namespace ui |
| OLD | NEW |