| Index: ui/android/overscroll_refresh.h
|
| diff --git a/ui/android/overscroll_refresh.h b/ui/android/overscroll_refresh.h
|
| index 451805ed7c02c3d58b5a20ad3b7bdcab20887c5a..b5a36f8e96de783a7a02b62fb6a06ec005a4d91e 100644
|
| --- a/ui/android/overscroll_refresh.h
|
| +++ b/ui/android/overscroll_refresh.h
|
| @@ -5,6 +5,7 @@
|
| #ifndef UI_ANDROID_OVERSCROLL_REFRESH_H_
|
| #define UI_ANDROID_OVERSCROLL_REFRESH_H_
|
|
|
| +#include "base/android/scoped_java_ref.h"
|
| #include "base/macros.h"
|
| #include "ui/android/ui_android_export.h"
|
| #include "ui/gfx/geometry/size_f.h"
|
| @@ -12,27 +13,6 @@
|
|
|
| namespace ui {
|
|
|
| -class UI_ANDROID_EXPORT OverscrollRefreshHandler {
|
| - public:
|
| - // Signals the start of an overscrolling pull. Returns whether the handler
|
| - // will consume the overscroll gesture, in which case it will receive the
|
| - // remaining pull updates.
|
| - virtual bool PullStart() = 0;
|
| -
|
| - // Signals a pull update, where |delta| is in device pixels.
|
| - virtual void PullUpdate(float delta) = 0;
|
| -
|
| - // Signals the release of the pull, and whether the release is allowed to
|
| - // trigger the refresh action.
|
| - virtual void PullRelease(bool allow_refresh) = 0;
|
| -
|
| - // Reset the active pull state.
|
| - virtual void PullReset() = 0;
|
| -
|
| - protected:
|
| - virtual ~OverscrollRefreshHandler() {}
|
| -};
|
| -
|
| // Simple pull-to-refresh styled effect. Listens to scroll events, conditionally
|
| // activating when:
|
| // 1) The scroll begins when the page's root layer 1) has no vertical scroll
|
| @@ -48,7 +28,7 @@ class UI_ANDROID_EXPORT OverscrollRefresh {
|
| // capping the impulse per event.
|
| enum { kMinPullsToActivate = 3 };
|
|
|
| - explicit OverscrollRefresh(OverscrollRefreshHandler* handler);
|
| + explicit OverscrollRefresh(const base::android::JavaRef<jobject>& handler);
|
| ~OverscrollRefresh();
|
|
|
| // Scroll event stream listening methods.
|
| @@ -94,7 +74,7 @@ class UI_ANDROID_EXPORT OverscrollRefresh {
|
| ENABLED,
|
| } scroll_consumption_state_;
|
|
|
| - OverscrollRefreshHandler* const handler_;
|
| + const base::android::ScopedJavaGlobalRef<jobject> handler_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(OverscrollRefresh);
|
| };
|
|
|