| Index: chrome/browser/android/swipe_refresh_handler.h
|
| diff --git a/chrome/browser/android/swipe_refresh_handler.h b/chrome/browser/android/swipe_refresh_handler.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..59f666fd875d006d409a950910f414536ca920f5
|
| --- /dev/null
|
| +++ b/chrome/browser/android/swipe_refresh_handler.h
|
| @@ -0,0 +1,33 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef CHROME_BROWSER_ANDROID_SWIPE_REFRESH_HANDLER_H_
|
| +#define CHROME_BROWSER_ANDROID_SWIPE_REFRESH_HANDLER_H_
|
| +
|
| +#include "base/android/jni_android.h"
|
| +#include "base/android/jni_weak_ref.h"
|
| +#include "ui/android/overscroll_refresh.h"
|
| +
|
| +class SwipeRefreshHandler : public ui::OverscrollRefreshHandler {
|
| + public:
|
| + SwipeRefreshHandler(JNIEnv* env, const base::android::JavaRef<jobject>& obj);
|
| +
|
| + bool PullStart() override;
|
| + void PullUpdate(float delta) override;
|
| + void PullRelease(bool allow_refresh) override;
|
| + void PullReset() override;
|
| +
|
| + void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
|
| +
|
| + // Register the SwipeRefreshHandler's native methods through JNI.
|
| + static bool RegisterSwipeRefreshHandler(JNIEnv* env);
|
| +
|
| + private:
|
| + // A weak reference to the Java SwipeRefreshHandler object.
|
| + JavaObjectWeakGlobalRef java_ref_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(SwipeRefreshHandler);
|
| +};
|
| +
|
| +#endif // CHROME_BROWSER_ANDROID_SWIPE_REFRESH_HANDLER_H_
|
|
|