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

Unified Diff: chrome/browser/android/swipe_refresh_handler.h

Issue 2528823002: Separate SwipeRefreshHandler and ContentViewCore (Closed)
Patch Set: Fix compile error in test case Created 4 years, 1 month 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: 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_

Powered by Google App Engine
This is Rietveld 408576698