OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef BASE_ANDROID_CALLBACK_ANDROID_H_ | 5 #ifndef BASE_ANDROID_CALLBACK_ANDROID_H_ |
6 #define BASE_ANDROID_CALLBACK_ANDROID_H_ | 6 #define BASE_ANDROID_CALLBACK_ANDROID_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 | 9 |
10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
11 #include "base/base_export.h" | 11 #include "base/base_export.h" |
12 | 12 |
13 namespace base { | 13 namespace base { |
14 namespace android { | 14 namespace android { |
15 | 15 |
16 // Runs the given |callback| with the specified |arg|. | 16 // Runs the given |callback| with the specified |arg|. |
17 void BASE_EXPORT RunCallbackAndroid(const JavaRef<jobject>& callback, | 17 void BASE_EXPORT RunCallbackAndroid(const JavaRef<jobject>& callback, |
18 const JavaRef<jobject>& arg); | 18 const JavaRef<jobject>& arg); |
19 | 19 |
20 // Runs the given |callback| with the specified |arg|. | 20 // Runs the given |callback| with the specified |arg|. |
21 void BASE_EXPORT RunCallbackAndroid(const JavaRef<jobject>& callback, | 21 void BASE_EXPORT RunCallbackAndroid(const JavaRef<jobject>& callback, |
22 bool arg); | 22 bool arg); |
23 | 23 |
24 // Runs the given |callback| with the specified |arg|. | 24 // Runs the given |callback| with the specified |arg|. |
25 void BASE_EXPORT RunCallbackAndroid(const JavaRef<jobject>& callback, int arg); | 25 void BASE_EXPORT RunCallbackAndroid(const JavaRef<jobject>& callback, int arg); |
26 | 26 |
27 // JNI registration boilerplate. | |
28 bool RegisterCallbackAndroid(JNIEnv* env); | |
29 | |
30 } // namespace android | 27 } // namespace android |
31 } // namespace base | 28 } // namespace base |
32 | 29 |
33 #endif // BASE_ANDROID_CALLBACK_ANDROID_H_ | 30 #endif // BASE_ANDROID_CALLBACK_ANDROID_H_ |
OLD | NEW |