| 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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, | 144 net::URLFetcher::RequestType request_type, |
| 145 const GURL& server_url); | 145 const GURL& server_url); |
| 146 | 146 |
| 147 // Called with the URL of generated WebAPK and the package name that the | 147 // Called with the URL of generated WebAPK and the package name that the |
| 148 // WebAPK should be installed at. | 148 // WebAPK should be installed at. |
| 149 void OnGotWebApkDownloadUrl(const GURL& download_url, | 149 void OnGotWebApkDownloadUrl(const GURL& download_url, |
| 150 const std::string& package_name); | 150 const std::string& package_name); |
| 151 | 151 |
| 152 // Called once the sub directory to store the downloaded WebAPK was |
| 153 // created with permissions set properly or if creation failed. |
| 154 void OnCreatedSubDirAndSetPermissions(const GURL& download_url, |
| 155 const base::FilePath& file_path); |
| 156 |
| 152 // Called once the WebAPK has been downloaded. Makes the downloaded WebAPK | 157 // Called once the WebAPK has been downloaded. Makes the downloaded WebAPK |
| 153 // world readable and installs the WebAPK if the download was successful. | 158 // world readable and installs the WebAPK if the download was successful. |
| 154 // |file_path| is the file path that the WebAPK was downloaded to. | 159 // |file_path| is the file path that the WebAPK was downloaded to. |
| 155 void OnWebApkDownloaded(const base::FilePath& file_path, | 160 void OnWebApkDownloaded(const base::FilePath& file_path, |
| 156 FileDownloader::Result result); | 161 FileDownloader::Result result); |
| 157 | 162 |
| 158 // Called once the downloaded WebAPK has been made world readable. Installs | 163 // Called once the downloaded WebAPK has been made world readable. Installs |
| 159 // the WebAPK. | 164 // the WebAPK. |
| 160 // |file_path| is the file path that the WebAPK was downloaded to. | 165 // |file_path| is the file path that the WebAPK was downloaded to. |
| 161 // |change_permission_success| is whether the WebAPK could be made world | 166 // |change_permission_success| is whether the WebAPK could be made world |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 // Points to the Java Object. | 228 // Points to the Java Object. |
| 224 base::android::ScopedJavaGlobalRef<jobject> java_ref_; | 229 base::android::ScopedJavaGlobalRef<jobject> java_ref_; |
| 225 | 230 |
| 226 // Used to get |weak_ptr_|. | 231 // Used to get |weak_ptr_|. |
| 227 base::WeakPtrFactory<WebApkInstaller> weak_ptr_factory_; | 232 base::WeakPtrFactory<WebApkInstaller> weak_ptr_factory_; |
| 228 | 233 |
| 229 DISALLOW_COPY_AND_ASSIGN(WebApkInstaller); | 234 DISALLOW_COPY_AND_ASSIGN(WebApkInstaller); |
| 230 }; | 235 }; |
| 231 | 236 |
| 232 #endif // CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_INSTALLER_H_ | 237 #endif // CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_INSTALLER_H_ |
| OLD | NEW |