| 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 CHROME_BROWSER_ANDROID_SWIPE_REFRESH_HANDLER_H_ |
| 6 #define CHROME_BROWSER_ANDROID_SWIPE_REFRESH_HANDLER_H_ |
| 7 |
| 8 #include "base/android/jni_android.h" |
| 9 #include "base/android/jni_weak_ref.h" |
| 10 #include "ui/android/overscroll_refresh.h" |
| 11 |
| 12 class SwipeRefreshHandler : public ui::OverscrollRefreshHandler { |
| 13 public: |
| 14 SwipeRefreshHandler(JNIEnv* env, const base::android::JavaRef<jobject>& obj); |
| 15 |
| 16 bool PullStart() override; |
| 17 void PullUpdate(float delta) override; |
| 18 void PullRelease(bool allow_refresh) override; |
| 19 void PullReset() override; |
| 20 |
| 21 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); |
| 22 |
| 23 // Register the SwipeRefreshHandler's native methods through JNI. |
| 24 static bool RegisterSwipeRefreshHandler(JNIEnv* env); |
| 25 |
| 26 private: |
| 27 // A weak reference to the Java SwipeRefreshHandler object. |
| 28 JavaObjectWeakGlobalRef java_ref_; |
| 29 |
| 30 DISALLOW_COPY_AND_ASSIGN(SwipeRefreshHandler); |
| 31 }; |
| 32 |
| 33 #endif // CHROME_BROWSER_ANDROID_SWIPE_REFRESH_HANDLER_H_ |
| OLD | NEW |