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

Unified Diff: ui/android/overscroll_refresh_handler.cc

Issue 2528823002: Separate SwipeRefreshHandler and ContentViewCore (Closed)
Patch Set: tedchoc's requested changes Created 4 years 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
« no previous file with comments | « ui/android/overscroll_refresh_handler.h ('k') | ui/android/overscroll_refresh_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/android/overscroll_refresh_handler.cc
diff --git a/ui/android/overscroll_refresh_handler.cc b/ui/android/overscroll_refresh_handler.cc
new file mode 100644
index 0000000000000000000000000000000000000000..49b2f71542315337fa4f4cbcb31c500c1146e88d
--- /dev/null
+++ b/ui/android/overscroll_refresh_handler.cc
@@ -0,0 +1,42 @@
+// 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.
+
+#include "ui/android/overscroll_refresh_handler.h"
+
+#include "base/android/jni_android.h"
+#include "jni/OverscrollRefreshHandler_jni.h"
+
+using base::android::AttachCurrentThread;
+
+namespace ui {
+
+OverscrollRefreshHandler::OverscrollRefreshHandler(
+ const base::android::JavaRef<jobject>& j_overscroll_refresh_handler) {
+ j_overscroll_refresh_handler_.Reset(AttachCurrentThread(),
+ j_overscroll_refresh_handler.obj());
+}
+
+OverscrollRefreshHandler::~OverscrollRefreshHandler() {}
+
+bool OverscrollRefreshHandler::PullStart() {
+ return Java_OverscrollRefreshHandler_start(AttachCurrentThread(),
+ j_overscroll_refresh_handler_);
+}
+
+void OverscrollRefreshHandler::PullUpdate(float delta) {
+ Java_OverscrollRefreshHandler_pull(AttachCurrentThread(),
+ j_overscroll_refresh_handler_, delta);
+}
+
+void OverscrollRefreshHandler::PullRelease(bool allow_refresh) {
+ Java_OverscrollRefreshHandler_release(
+ AttachCurrentThread(), j_overscroll_refresh_handler_, allow_refresh);
+}
+
+void OverscrollRefreshHandler::PullReset() {
+ Java_OverscrollRefreshHandler_reset(AttachCurrentThread(),
+ j_overscroll_refresh_handler_);
+}
+
+} // namespace ui
« no previous file with comments | « ui/android/overscroll_refresh_handler.h ('k') | ui/android/overscroll_refresh_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698