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

Side by Side Diff: chrome/browser/ui/webui/webapk_info_callback.h

Issue 2629573004: Add a chrome://webapks page. (Closed)
Patch Set: Adds an about:webapks page with information about all installed Web APKs on the device Created 3 years, 11 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 unified diff | Download patch
OLDNEW
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698