| 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_DOWNLOAD_DOWNLOAD_CONTROLLER_BASE_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_CONTROLLER_BASE_H_ |
| 6 #define CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_CONTROLLER_BASE_H_ | 6 #define CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_CONTROLLER_BASE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 content::WebContents* web_contents, | 65 content::WebContents* web_contents, |
| 66 bool is_link, const std::string& extra_headers) = 0; | 66 bool is_link, const std::string& extra_headers) = 0; |
| 67 | 67 |
| 68 // Callback when user permission prompt finishes. Args: whether file access | 68 // Callback when user permission prompt finishes. Args: whether file access |
| 69 // permission is acquired. | 69 // permission is acquired. |
| 70 typedef base::Callback<void(bool)> AcquireFileAccessPermissionCallback; | 70 typedef base::Callback<void(bool)> AcquireFileAccessPermissionCallback; |
| 71 | 71 |
| 72 // Called to prompt the user for file access permission. When finished, | 72 // Called to prompt the user for file access permission. When finished, |
| 73 // |callback| will be executed. | 73 // |callback| will be executed. |
| 74 virtual void AcquireFileAccessPermission( | 74 virtual void AcquireFileAccessPermission( |
| 75 content::WebContents* web_contents, | 75 const content::ResourceRequestInfo::WebContentsGetter& wc_getter, |
| 76 const AcquireFileAccessPermissionCallback& callback) = 0; | 76 const AcquireFileAccessPermissionCallback& callback) = 0; |
| 77 | 77 |
| 78 // Called by unit test to approve or disapprove file access request. | 78 // Called by unit test to approve or disapprove file access request. |
| 79 virtual void SetApproveFileAccessRequestForTesting(bool approve) {} | 79 virtual void SetApproveFileAccessRequestForTesting(bool approve) {} |
| 80 | 80 |
| 81 // Starts a new download request with Android DownloadManager. | 81 // Starts a new download request with Android DownloadManager. |
| 82 virtual void CreateAndroidDownload( | 82 virtual void CreateAndroidDownload( |
| 83 const content::ResourceRequestInfo::WebContentsGetter& wc_getter, | 83 const content::ResourceRequestInfo::WebContentsGetter& wc_getter, |
| 84 const DownloadInfo& info) = 0; | 84 const DownloadInfo& info) = 0; |
| 85 | 85 |
| 86 protected: | 86 protected: |
| 87 ~DownloadControllerBase() override {} | 87 ~DownloadControllerBase() override {} |
| 88 static DownloadControllerBase* download_controller_; | 88 static DownloadControllerBase* download_controller_; |
| 89 }; | 89 }; |
| 90 | 90 |
| 91 #endif // CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_CONTROLLER_BASE_H_ | 91 #endif // CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_CONTROLLER_BASE_H_ |
| OLD | NEW |