Index: chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkInstallClientDelegate.java |
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkInstallClientDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkInstallClientDelegate.java |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6c443954ee209c052af50ade2ed2f226aa123171 |
--- /dev/null |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkInstallClientDelegate.java |
@@ -0,0 +1,38 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+package org.chromium.chrome.browser.webapps; |
+ |
+import android.os.Bundle; |
+ |
+/** |
+ * Binds to Phonesky's PlayInstallService to install WebAPKs. |
+ */ |
+public abstract class WebApkInstallClientDelegate { |
+ /** |
+ * Class to inform when the installation was either completed or failed. |
+ */ |
+ public interface Observer { |
+ /** |
+ * Called when the installation status changed. |
+ * @param success Whether the installation succeeded. |
+ */ |
+ public void onInstallStateChanged(boolean success); |
+ } |
+ |
+ /** |
+ * Binds to Phonesky's PlayInstallService and installs WebAPKs asynchronously. |
+ * @param installPackage The package name of WebAPK to install. |
+ * @param installOptions The data required by the installation. |
+ * @return True if either successfully binded to the PlayInstallService or the install was |
+ * started. A "true" return value does not guarantee that the install succeeds. |
+ */ |
+ public abstract boolean installAsync(Observer observer, String installPackage, |
+ Bundle installOptions); |
+ |
+ /** |
+ * Destroy the delegate, cleaning up any open hooks. |
+ */ |
+ public abstract void reset(); |
+} |