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 package org.chromium.chrome.browser.webapps; | 5 package org.chromium.chrome.browser.webapps; |
6 | 6 |
7 import android.support.annotation.IntDef; | 7 import android.support.annotation.IntDef; |
8 | 8 |
9 import org.chromium.base.Callback; | 9 import org.chromium.base.Callback; |
10 | 10 |
(...skipping 20 matching lines...) Expand all Loading... |
31 public static final int INSTALL_ERROR = 5; | 31 public static final int INSTALL_ERROR = 5; |
32 public static final int INSTALLED = 6; | 32 public static final int INSTALLED = 6; |
33 | 33 |
34 /** | 34 /** |
35 * Uses Google Play to install WebAPK asynchronously. | 35 * Uses Google Play to install WebAPK asynchronously. |
36 * @param packageName The package name of WebAPK to install. | 36 * @param packageName The package name of WebAPK to install. |
37 * @param version The version of WebAPK to install. | 37 * @param version The version of WebAPK to install. |
38 * @param title The title of the WebAPK to display during installation. | 38 * @param title The title of the WebAPK to display during installation. |
39 * @param token The token from WebAPK Minter Server. | 39 * @param token The token from WebAPK Minter Server. |
40 * @param url The start URL of the WebAPK to install. | 40 * @param url The start URL of the WebAPK to install. |
41 * @param callback The callback to invoke when the install is either complet
ed or failed. | 41 * @param callback The callback to invoke when the install completes, times
out or fails. |
42 */ | 42 */ |
43 void installAsync(String packageName, int version, String title, String toke
n, String url, | 43 void installAsync(String packageName, int version, String title, String toke
n, String url, |
44 Callback<Boolean> callback); | 44 Callback<Integer> callback); |
45 | 45 |
46 /** | 46 /** |
47 * Calls the callback once the installation either succeeded or failed. | 47 * Calls the callback once the installation either succeeded or failed. |
48 * @param packageName The package name of WebAPK for the installation. | 48 * @param packageName The package name of WebAPK for the installation. |
49 * @param event The result of the install. | 49 * @param event The result of the install. |
50 */ | 50 */ |
51 void onGotInstallEvent(String packageName, @InstallerPackageEvent int event)
; | 51 void onGotInstallEvent(String packageName, @InstallerPackageEvent int event)
; |
52 | |
53 /** | |
54 * Checks whether Google Play Install API is available. | |
55 * @param callback The callback to invoke when the check is done. | |
56 */ | |
57 void canInstallWebApk(Callback<Boolean> callback); | |
58 } | 52 } |
OLD | NEW |