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

Unified Diff: base/android/callback_android.h

Issue 1996193003: Add support for calling the java Callback from native. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 7 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
« no previous file with comments | « base/android/base_jni_registrar.cc ('k') | base/android/callback_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/android/callback_android.h
diff --git a/base/android/callback_android.h b/base/android/callback_android.h
new file mode 100644
index 0000000000000000000000000000000000000000..c044d9c86e56cf97e835e87f68650c09755aa8e3
--- /dev/null
+++ b/base/android/callback_android.h
@@ -0,0 +1,30 @@
+// 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 BASE_ANDROID_CALLBACK_ANDROID_H_
+#define BASE_ANDROID_CALLBACK_ANDROID_H_
+
+#include <jni.h>
+
+#include "base/android/scoped_java_ref.h"
+#include "base/base_export.h"
+
+namespace base {
+namespace android {
+
+// Runs the given |callback| with the specified |arg|.
+void BASE_EXPORT RunCallbackAndroid(const JavaRef<jobject>& callback,
+ const JavaRef<jobject>& arg);
+
+// Runs the given |callback| with the specified |arg|.
+void BASE_EXPORT RunCallbackAndroid(const JavaRef<jobject>& callback,
+ bool arg);
+
+// JNI registration boilerplate.
+bool RegisterCallbackAndroid(JNIEnv* env);
+
+} // namespace android
+} // namespace base
+
+#endif // BASE_ANDROID_CALLBACK_ANDROID_H_
« no previous file with comments | « base/android/base_jni_registrar.cc ('k') | base/android/callback_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698