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 <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 98 const base::android::ScopedJavaLocalRef<jstring>& java_file_path, | 98 const base::android::ScopedJavaLocalRef<jstring>& java_file_path, |
| 99 const base::android::ScopedJavaLocalRef<jstring>& java_package_name); | 99 const base::android::ScopedJavaLocalRef<jstring>& java_package_name); |
| 100 | 100 |
| 101 // Starts update using the downloaded WebAPK. Returns whether the updating | 101 // Starts update using the downloaded WebAPK. Returns whether the updating |
| 102 // could be started. The updating may still fail if true is returned. | 102 // could be started. The updating may still fail if true is returned. |
| 103 // |file_path| is the file path that the WebAPK was downloaded to. | 103 // |file_path| is the file path that the WebAPK was downloaded to. |
| 104 virtual bool StartUpdateUsingDownloadedWebApk( | 104 virtual bool StartUpdateUsingDownloadedWebApk( |
| 105 JNIEnv* env, | 105 JNIEnv* env, |
| 106 const base::android::ScopedJavaLocalRef<jstring>& java_file_path); | 106 const base::android::ScopedJavaLocalRef<jstring>& java_file_path); |
| 107 | 107 |
| 108 // Returns whether installing WebAPKs using Google Play is enabled. | |
| 109 virtual bool HasGooglePlayWebApkInstallDelegate(); | |
|
dominickn
2016/12/08 03:31:26
CanInstallFromPlay?
Xi Han
2016/12/08 18:03:07
Update the description here.
| |
| 110 | |
| 111 // Called when the package name of the WebAPK is available and the install | |
| 112 // or update request is handled by Google Play. | |
| 113 virtual bool InstallOrUpdateWebApkFromGooglePlay( | |
| 114 const std::string& package_name, | |
| 115 int version, | |
| 116 const std::string& token); | |
| 117 | |
| 108 // Called when the request to install the WebAPK is sent to Google Play. | 118 // Called when the request to install the WebAPK is sent to Google Play. |
| 109 void OnSuccess(); | 119 void OnSuccess(); |
| 110 | 120 |
| 111 private: | 121 private: |
| 112 enum TaskType { | 122 enum TaskType { |
| 113 UNDEFINED, | 123 UNDEFINED, |
| 114 INSTALL, | 124 INSTALL, |
| 115 UPDATE, | 125 UPDATE, |
| 116 }; | 126 }; |
| 117 | 127 |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 236 // Points to the Java Object. | 246 // Points to the Java Object. |
| 237 base::android::ScopedJavaGlobalRef<jobject> java_ref_; | 247 base::android::ScopedJavaGlobalRef<jobject> java_ref_; |
| 238 | 248 |
| 239 // Used to get |weak_ptr_|. | 249 // Used to get |weak_ptr_|. |
| 240 base::WeakPtrFactory<WebApkInstaller> weak_ptr_factory_; | 250 base::WeakPtrFactory<WebApkInstaller> weak_ptr_factory_; |
| 241 | 251 |
| 242 DISALLOW_COPY_AND_ASSIGN(WebApkInstaller); | 252 DISALLOW_COPY_AND_ASSIGN(WebApkInstaller); |
| 243 }; | 253 }; |
| 244 | 254 |
| 245 #endif // CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_INSTALLER_H_ | 255 #endif // CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_INSTALLER_H_ |
| OLD | NEW |