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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 | 134 |
135 // Sends request to WebAPK server to update a WebAPK. During a successful | 135 // Sends request to WebAPK server to update a WebAPK. During a successful |
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 net::URLFetcher::RequestType request_type, | |
145 const GURL& server_url); | 144 const GURL& server_url); |
146 | 145 |
147 // Called with the URL of generated WebAPK and the package name that the | 146 // Called with the URL of generated WebAPK and the package name that the |
148 // WebAPK should be installed at. | 147 // WebAPK should be installed at. |
149 void OnGotWebApkDownloadUrl(const GURL& download_url, | 148 void OnGotWebApkDownloadUrl(const GURL& download_url, |
150 const std::string& package_name); | 149 const std::string& package_name); |
151 | 150 |
152 // Downloads the WebAPK from the given |download_url|. | 151 // Downloads the WebAPK from the given |download_url|. |
153 void DownloadWebApk(const base::FilePath& output_path, | 152 void DownloadWebApk(const base::FilePath& output_path, |
154 const GURL& download_url, | 153 const GURL& download_url, |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 // Points to the Java Object. | 236 // Points to the Java Object. |
238 base::android::ScopedJavaGlobalRef<jobject> java_ref_; | 237 base::android::ScopedJavaGlobalRef<jobject> java_ref_; |
239 | 238 |
240 // Used to get |weak_ptr_|. | 239 // Used to get |weak_ptr_|. |
241 base::WeakPtrFactory<WebApkInstaller> weak_ptr_factory_; | 240 base::WeakPtrFactory<WebApkInstaller> weak_ptr_factory_; |
242 | 241 |
243 DISALLOW_COPY_AND_ASSIGN(WebApkInstaller); | 242 DISALLOW_COPY_AND_ASSIGN(WebApkInstaller); |
244 }; | 243 }; |
245 | 244 |
246 #endif // CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_INSTALLER_H_ | 245 #endif // CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_INSTALLER_H_ |
OLD | NEW |