Chromium Code Reviews| 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 #ifndef CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_INSTALLER_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_INSTALLER_H_ |
| 6 #define CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_INSTALLER_H_ | 6 #define CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_INSTALLER_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 117 const base::android::ScopedJavaLocalRef<jstring>& java_file_path, | 117 const base::android::ScopedJavaLocalRef<jstring>& java_file_path, |
| 118 const base::android::ScopedJavaLocalRef<jstring>& java_package_name); | 118 const base::android::ScopedJavaLocalRef<jstring>& java_package_name); |
| 119 | 119 |
| 120 // Starts update using the downloaded WebAPK. Returns whether the updating | 120 // Starts update using the downloaded WebAPK. Returns whether the updating |
| 121 // could be started. The updating may still fail if true is returned. | 121 // could be started. The updating may still fail if true is returned. |
| 122 // |file_path| is the file path that the WebAPK was downloaded to. | 122 // |file_path| is the file path that the WebAPK was downloaded to. |
| 123 virtual bool StartUpdateUsingDownloadedWebApk( | 123 virtual bool StartUpdateUsingDownloadedWebApk( |
| 124 JNIEnv* env, | 124 JNIEnv* env, |
| 125 const base::android::ScopedJavaLocalRef<jstring>& java_file_path); | 125 const base::android::ScopedJavaLocalRef<jstring>& java_file_path); |
| 126 | 126 |
| 127 // Returns whether the Google Play install delegate is available. | 127 // Returns whether Google Play Service can be used and the install delegate is |
|
dominickn
2017/01/18 00:07:02
nit: "Google Play Services"
Xi Han
2017/01/18 14:53:27
Done.
| |
| 128 // available. | |
| 128 // Note: it is possible that this delegate is null even when installing | 129 // Note: it is possible that this delegate is null even when installing |
| 129 // WebAPKs using Google Play is enabled. | 130 // WebAPKs using Google Play is enabled. |
| 130 virtual bool HasGooglePlayWebApkInstallDelegate(); | 131 virtual bool CanUseGooglePlayInstallService(); |
| 131 | 132 |
| 132 // Called when the package name of the WebAPK is available and the install | 133 // Called when the package name of the WebAPK is available and the install |
| 133 // or update request is handled by Google Play. | 134 // or update request is handled by Google Play. |
| 134 virtual bool InstallOrUpdateWebApkFromGooglePlay( | 135 virtual bool InstallOrUpdateWebApkFromGooglePlay( |
| 135 const std::string& package_name, | 136 const std::string& package_name, |
| 136 int version, | 137 int version, |
| 137 const std::string& token); | 138 const std::string& token); |
| 138 | 139 |
| 139 // Called when the request to install the WebAPK is sent to Google Play. | 140 // Called when the request to install the WebAPK is sent to Google Play. |
| 140 void OnSuccess(); | 141 void OnSuccess(); |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 278 // Points to the Java Object. | 279 // Points to the Java Object. |
| 279 base::android::ScopedJavaGlobalRef<jobject> java_ref_; | 280 base::android::ScopedJavaGlobalRef<jobject> java_ref_; |
| 280 | 281 |
| 281 // Used to get |weak_ptr_|. | 282 // Used to get |weak_ptr_|. |
| 282 base::WeakPtrFactory<WebApkInstaller> weak_ptr_factory_; | 283 base::WeakPtrFactory<WebApkInstaller> weak_ptr_factory_; |
| 283 | 284 |
| 284 DISALLOW_COPY_AND_ASSIGN(WebApkInstaller); | 285 DISALLOW_COPY_AND_ASSIGN(WebApkInstaller); |
| 285 }; | 286 }; |
| 286 | 287 |
| 287 #endif // CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_INSTALLER_H_ | 288 #endif // CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_INSTALLER_H_ |
| OLD | NEW |