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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 // request the WebAPK server responds with the URL of the generated WebAPK. | 136 // request the WebAPK server responds with the URL of the generated WebAPK. |
137 // |webapk| is the proto to send to the WebAPK server. | 137 // |webapk| is the proto to send to the WebAPK server. |
138 void SendUpdateWebApkRequest(std::unique_ptr<webapk::WebApk> webapk_proto); | 138 void SendUpdateWebApkRequest(std::unique_ptr<webapk::WebApk> webapk_proto); |
139 | 139 |
140 // Sends a request to WebAPK server to create/update WebAPK. During a | 140 // Sends a request to WebAPK server to create/update WebAPK. During a |
141 // successful request the WebAPK server responds with the URL of the generated | 141 // successful request the WebAPK server responds with the URL of the generated |
142 // WebAPK. | 142 // WebAPK. |
143 void SendRequest(std::unique_ptr<webapk::WebApk> request_proto, | 143 void SendRequest(std::unique_ptr<webapk::WebApk> request_proto, |
144 const GURL& server_url); | 144 const GURL& server_url); |
145 | 145 |
| 146 // Called when the package name of the WebAPK is available and with the flag |
| 147 // "enable-play-install-improved-a2hs" being turned on. |
| 148 void InstallWebApkFromPlayStore(const std::string& package_name, |
| 149 int version, |
| 150 const std::string& token); |
| 151 |
146 // Called with the URL of generated WebAPK and the package name that the | 152 // Called with the URL of generated WebAPK and the package name that the |
147 // WebAPK should be installed at. | 153 // WebAPK should be installed at. |
148 void OnGotWebApkDownloadUrl(const GURL& download_url, | 154 void OnGotWebApkDownloadUrl(const GURL& download_url, |
149 const std::string& package_name); | 155 const std::string& package_name); |
150 | 156 |
151 // Downloads the WebAPK from the given |download_url|. | 157 // Downloads the WebAPK from the given |download_url|. |
152 void DownloadWebApk(const base::FilePath& output_path, | 158 void DownloadWebApk(const base::FilePath& output_path, |
153 const GURL& download_url, | 159 const GURL& download_url, |
154 bool retry_if_fails); | 160 bool retry_if_fails); |
155 | 161 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 // Points to the Java Object. | 242 // Points to the Java Object. |
237 base::android::ScopedJavaGlobalRef<jobject> java_ref_; | 243 base::android::ScopedJavaGlobalRef<jobject> java_ref_; |
238 | 244 |
239 // Used to get |weak_ptr_|. | 245 // Used to get |weak_ptr_|. |
240 base::WeakPtrFactory<WebApkInstaller> weak_ptr_factory_; | 246 base::WeakPtrFactory<WebApkInstaller> weak_ptr_factory_; |
241 | 247 |
242 DISALLOW_COPY_AND_ASSIGN(WebApkInstaller); | 248 DISALLOW_COPY_AND_ASSIGN(WebApkInstaller); |
243 }; | 249 }; |
244 | 250 |
245 #endif // CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_INSTALLER_H_ | 251 #endif // CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_INSTALLER_H_ |
OLD | NEW |