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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/webapps/WebapkInfoCallback.java

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 Update the year - it's 2017 now :)
gonzalon 2017/01/13 20:24:38 I copy pasted this everywhere without checking the
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 package org.chromium.chrome.browser.webapps;
6
7 import org.chromium.base.annotations.CalledByNative;
8
9 /** A simple callback to load the information on web APKs. */
10 public class WebapkInfoCallback {
Xi Han 2017/01/13 15:50:15 Anyone has suggestion about the naming of this cla
11 private long mNativeWebapkInfoCallback;
12
13 /**
14 * Called with information of one Web APK. When information is requested, it will be called once
hartmanng 2017/01/13 15:40:21 nit: for consistency, we generally spell it "WebAP
gonzalon 2017/01/13 20:24:38 Done.
15 * for each Web APK installed on the device.
16 *
17 * @param name The name of the Web APK.
18 * @param packageName The package name of the Web APK.
19 * @param shellApkVersion The version of the shell APK of the Web APK.
20 * @param versionCode The version code associated with the Web APK.
21 */
22 public void onWebApkFound(
23 String name, String packageName, int shellApkVersion, int versionCod e) {
24 nativeOnWebApkFound(
25 mNativeWebapkInfoCallback, name, packageName, shellApkVersion, v ersionCode);
26 }
27
28 /** Destroys the native counterpart of this object. */
29 public void destroy() {
pkotwicz 2017/01/13 17:00:58 I must be missing something. Who calls destroy()?
gonzalon 2017/01/13 20:24:38 I forgot to add the call, I added it on the listWe
30 nativeDestroy(mNativeWebapkInfoCallback);
31 mNativeWebapkInfoCallback = 0;
32 }
33
34 /**
35 * Called from C++ by |nativeWebApkInfoCallback| to instantiate this class. Note that this is
36 * the only way to construct an WebapkInfoCallback; the constructor is priva te.
37 * @param nativeWebApkInfoCallback The native counterpart that creates and o wns this object.
38 */
39 @CalledByNative
40 private static WebapkInfoCallback create(long nativeWebApkInfoCallback) {
41 return new WebapkInfoCallback(nativeWebApkInfoCallback);
42 }
43
44 private WebapkInfoCallback(long nativeWebapkInfoCallback) {
45 mNativeWebapkInfoCallback = nativeWebapkInfoCallback;
46 }
47
48 private native void nativeOnWebApkFound(long nativeWebapkInfoCallback, Strin g name,
49 String packageName, int shellApkVersion, int versionCode);
50 private native void nativeDestroy(long nativeWebapkInfoCallback);
51 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698