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

Unified Diff: ui/android/overscroll_refresh.h

Issue 2884423003: Use scroll-boundary-behavior to control overscroll-refresh/glow on android. (Closed)
Patch Set: Update the test Created 3 years, 6 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
Index: ui/android/overscroll_refresh.h
diff --git a/ui/android/overscroll_refresh.h b/ui/android/overscroll_refresh.h
index 7cb98e272ce711c843103d3b2ffa62d33b9296b5..0ec96fb69dbcff5e43bf700fcad0726625eb9863 100644
--- a/ui/android/overscroll_refresh.h
+++ b/ui/android/overscroll_refresh.h
@@ -30,6 +30,8 @@ class UI_ANDROID_EXPORT OverscrollRefresh {
enum { kMinPullsToActivate = 3 };
explicit OverscrollRefresh(OverscrollRefreshHandler* handler);
+ // This constructor is for test only.
+ OverscrollRefresh();
majidvp 2017/07/12 21:04:21 ditto!
sunyunjia 2017/07/19 20:44:12 Done.
~OverscrollRefresh();
// Scroll event stream listening methods.
@@ -37,9 +39,10 @@ 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 the controller
+ // decides it can navigate based on the consumed result and
+ // scroll-boundary-behavior.
+ virtual void OnOverscrolled(bool can_navigate);
// Returns true if the effect has consumed the |scroll_delta|.
bool WillHandleScrollUpdate(const gfx::Vector2dF& scroll_delta);
@@ -58,10 +61,10 @@ class UI_ANDROID_EXPORT OverscrollRefresh {
void Reset();
// Returns true if the refresh effect is either being manipulated or animated.
- bool IsActive() const;
+ virtual bool IsActive() const;
// Returns true if the effect is waiting for an unconsumed scroll to start.
- bool IsAwaitingScrollUpdateAck() const;
+ virtual bool IsAwaitingScrollUpdateAck() const;
private:
void Release(bool allow_refresh);

Powered by Google App Engine
This is Rietveld 408576698