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

Unified Diff: content/browser/android/content_view_core_impl.cc

Issue 894193005: [Android] Use the platform SwipeRefreshLayout (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 8 months 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: content/browser/android/content_view_core_impl.cc
diff --git a/content/browser/android/content_view_core_impl.cc b/content/browser/android/content_view_core_impl.cc
index a7bcaecdef1ae181fb5a91fff2922cbc0b79b05f..e87fd3d51f9a87b1643cf46fe43fc777eaa9e092 100644
--- a/content/browser/android/content_view_core_impl.cc
+++ b/content/browser/android/content_view_core_impl.cc
@@ -1410,6 +1410,37 @@ void ContentViewCoreImpl::WebContentsDestroyed() {
wcva->SetContentViewCore(NULL);
}
+bool ContentViewCoreImpl::PullStart() {
+ JNIEnv* env = AttachCurrentThread();
+ ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
+ if (!obj.is_null())
+ return Java_ContentViewCore_onOverscrollRefreshStart(env, obj.obj());
+ return false;
+}
+
+void ContentViewCoreImpl::PullUpdate(float delta) {
+ JNIEnv* env = AttachCurrentThread();
+ ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
+ if (!obj.is_null())
+ Java_ContentViewCore_onOverscrollRefreshUpdate(env, obj.obj(), delta);
+}
+
+void ContentViewCoreImpl::PullRelease(bool allow_refresh) {
+ JNIEnv* env = AttachCurrentThread();
+ ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
+ if (!obj.is_null()) {
+ Java_ContentViewCore_onOverscrollRefreshRelease(env, obj.obj(),
+ allow_refresh);
+ }
+}
+
+void ContentViewCoreImpl::PullReset() {
+ JNIEnv* env = AttachCurrentThread();
+ ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
+ if (!obj.is_null())
+ Java_ContentViewCore_onOverscrollRefreshReset(env, obj.obj());
+}
+
// This is called for each ContentView.
jlong Init(JNIEnv* env,
jobject obj,
« no previous file with comments | « content/browser/android/content_view_core_impl.h ('k') | content/browser/android/overscroll_controller_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698