Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef UI_ANDROID_OVERSCROLL_REFRESH_HANDLER_H | |
| 6 #define UI_ANDROID_OVERSCROLL_REFRESH_HANDLER_H | |
| 7 | |
| 8 #include "base/android/scoped_java_ref.h" | |
| 9 #include "ui/android/ui_android_export.h" | |
| 10 | |
| 11 namespace ui { | |
| 12 | |
| 13 class UI_ANDROID_EXPORT OverscrollRefreshHandler { | |
| 14 public: | |
| 15 explicit OverscrollRefreshHandler( | |
| 16 const base::android::JavaRef<jobject>& j_overscroll_refresh_handler); | |
| 17 ~OverscrollRefreshHandler(); | |
| 18 // Signals the start of an overscrolling pull. Returns whether the handler | |
| 19 // will consume the overscroll gesture, in which case it will receive the | |
| 20 // remaining pull updates. | |
| 21 bool PullStart(); | |
| 22 | |
| 23 // Signals a pull update, where |delta| is in device pixels. | |
| 24 void PullUpdate(float delta); | |
| 25 | |
| 26 // Signals the release of the pull, and whether the release is allowed to | |
| 27 // trigger the refresh action. | |
| 28 void PullRelease(bool allow_refresh); | |
| 29 | |
| 30 // Reset the active pull state. | |
| 31 void PullReset(); | |
| 32 | |
| 33 private: | |
| 34 base::android::ScopedJavaGlobalRef<jobject> j_overscroll_refresh_handler_; | |
| 35 }; | |
|
boliu
2016/12/06 00:58:16
nit: empty line below
rlanday
2016/12/06 03:25:26
Ok
| |
| 36 } | |
| 37 | |
| 38 #endif // UI_ANDROID_OVERSCROLL_REFRESH_HANDLER_H | |
| OLD | NEW |