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

Unified Diff: ui/android/overscroll_refresh.h

Issue 2884423003: Use scroll-boundary-behavior to control overscroll-refresh/glow on android. (Closed)
Patch Set: Rebase Created 3 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/android/overscroll_glow.cc ('k') | ui/android/overscroll_refresh.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/android/overscroll_refresh.h
diff --git a/ui/android/overscroll_refresh.h b/ui/android/overscroll_refresh.h
index 7cb98e272ce711c843103d3b2ffa62d33b9296b5..f69b2f74cbff67d92fee0c8925b312c0ad842efc 100644
--- a/ui/android/overscroll_refresh.h
+++ b/ui/android/overscroll_refresh.h
@@ -30,6 +30,7 @@ class UI_ANDROID_EXPORT OverscrollRefresh {
enum { kMinPullsToActivate = 3 };
explicit OverscrollRefresh(OverscrollRefreshHandler* handler);
+
~OverscrollRefresh();
// Scroll event stream listening methods.
@@ -37,9 +38,11 @@ class UI_ANDROID_EXPORT OverscrollRefresh {
// Returns whether the refresh was activated.
void OnScrollEnd(const gfx::Vector2dF& velocity);
- // Scroll ack listener. The effect will only be activated if the initial
- // updates go unconsumed.
- void OnScrollUpdateAck(bool was_consumed);
+ // Scroll ack listener. The effect will only be activated if |can_navigate|
+ // is true which happens when the scroll update is not consumed and the
+ // scroll_boundary_behavior on y axis is 'auto'.
+ // This method is made virtual for mocking.
+ virtual void OnOverscrolled();
// Returns true if the effect has consumed the |scroll_delta|.
bool WillHandleScrollUpdate(const gfx::Vector2dF& scroll_delta);
@@ -55,13 +58,20 @@ class UI_ANDROID_EXPORT OverscrollRefresh {
// Reset the effect to its inactive state, immediately detaching and
// disabling any active effects.
- void Reset();
+ // This method is made virtual for mocking.
+ virtual void Reset();
// Returns true if the refresh effect is either being manipulated or animated.
- bool IsActive() const;
+ // This method is made virtual for mocking.
+ virtual bool IsActive() const;
// Returns true if the effect is waiting for an unconsumed scroll to start.
- bool IsAwaitingScrollUpdateAck() const;
+ // This method is made virtual for mocking.
+ virtual bool IsAwaitingScrollUpdateAck() const;
+
+ protected:
+ // This constructor is for mocking only.
+ OverscrollRefresh();
private:
void Release(bool allow_refresh);
« no previous file with comments | « ui/android/overscroll_glow.cc ('k') | ui/android/overscroll_refresh.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698