Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Side by Side Diff: ui/android/overscroll_refresh.cc

Issue 1419123002: android: move overscroll effects to ui/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix exports for component build Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/android/overscroll_refresh.h ('k') | ui/android/overscroll_refresh_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « ui/android/overscroll_refresh.h ('k') | ui/android/overscroll_refresh_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698