Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 } | |
| OLD | NEW |