OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
hartmanng
2017/01/13 15:40:21
s/2016/2017/
gonzalon
2017/01/13 20:24:39
Done.
| |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_UI_WEBUI_WEBAPK_INFO_CALLBACK_H_ | |
6 #define CHROME_BROWSER_UI_WEBUI_WEBAPK_INFO_CALLBACK_H_ | |
7 | |
8 #include "base/android/jni_weak_ref.h" | |
9 #include "base/android/scoped_java_ref.h" | |
10 #include "base/callback.h" | |
11 | |
12 // A callback wrapper for fetching information regarding the Web APKs installed | |
hartmanng
2017/01/13 15:40:21
s/Web APKs/WebAPKs/
gonzalon
2017/01/13 20:24:39
Done.
| |
13 // on the Android device. | |
14 class WebapkInfoCallback { | |
15 public: | |
16 explicit WebapkInfoCallback( | |
17 const base::RepeatingCallback<void(std::string, std::string, int, int)>& | |
18 callback); | |
19 ~WebapkInfoCallback(); | |
20 | |
21 // Destroys this object. | |
22 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); | |
23 | |
24 // Called by Java code with information about a Web APK. It will be called | |
25 // once for each one installed in the device. | |
26 void OnWebApkFound(JNIEnv* env, | |
27 const base::android::JavaParamRef<jobject>& obj, | |
28 const base::android::JavaParamRef<jstring>& name, | |
29 const base::android::JavaParamRef<jstring>& package_name, | |
30 const jint j_shell_apk_version, | |
31 const jint j_version_code) const; | |
32 | |
33 // The Java counterpart of this object. | |
34 const base::android::ScopedJavaGlobalRef<jobject>& j_webapk_info_callback() | |
35 const { | |
36 return j_webapk_info_callback_; | |
37 } | |
38 | |
39 // JNI registration. | |
40 static bool Register(JNIEnv* env); | |
41 | |
42 private: | |
43 // The wrapped native filter. | |
44 base::RepeatingCallback<void(std::string, std::string, int, int)> callback_; | |
45 | |
46 // The Java counterpart of this C++ object. | |
47 base::android::ScopedJavaGlobalRef<jobject> j_webapk_info_callback_; | |
48 | |
49 DISALLOW_COPY_AND_ASSIGN(WebapkInfoCallback); | |
50 }; | |
51 | |
52 #endif // CHROME_BROWSER_UI_WEBUI_WEBAPK_INFO_CALLBACK_H_ | |
OLD | NEW |