OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_DELEGATE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_DELEGATE_H_ |
6 #define CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_DELEGATE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_DELEGATE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 base::Callback<void(const base::FilePath& target_path, | 57 base::Callback<void(const base::FilePath& target_path, |
58 DownloadItem::TargetDisposition disposition, | 58 DownloadItem::TargetDisposition disposition, |
59 DownloadDangerType danger_type, | 59 DownloadDangerType danger_type, |
60 const base::FilePath& intermediate_path, | 60 const base::FilePath& intermediate_path, |
61 DownloadInterruptReason interrupt_reason)>; | 61 DownloadInterruptReason interrupt_reason)>; |
62 | 62 |
63 // Called when a download delayed by the delegate has completed. | 63 // Called when a download delayed by the delegate has completed. |
64 using DownloadOpenDelayedCallback = base::Callback<void(bool)>; | 64 using DownloadOpenDelayedCallback = base::Callback<void(bool)>; |
65 | 65 |
66 // Called with the result of CheckForFileExistence(). | 66 // Called with the result of CheckForFileExistence(). |
67 using CheckForFileExistenceCallback = base::Callback<void(bool result)>; | 67 using CheckForFileExistenceCallback = base::OnceCallback<void(bool result)>; |
68 | 68 |
69 using DownloadIdCallback = base::Callback<void(uint32_t)>; | 69 using DownloadIdCallback = base::Callback<void(uint32_t)>; |
70 | 70 |
71 // Browser's download manager: manages all downloads and destination view. | 71 // Browser's download manager: manages all downloads and destination view. |
72 class CONTENT_EXPORT DownloadManagerDelegate { | 72 class CONTENT_EXPORT DownloadManagerDelegate { |
73 public: | 73 public: |
74 // Lets the delegate know that the download manager is shutting down. | 74 // Lets the delegate know that the download manager is shutting down. |
75 virtual void Shutdown() {} | 75 virtual void Shutdown() {} |
76 | 76 |
77 // Runs |callback| with a new download id when possible, perhaps | 77 // Runs |callback| with a new download id when possible, perhaps |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 // relative path. | 145 // relative path. |
146 virtual void SanitizeSavePackageResourceName(base::FilePath* filename) {} | 146 virtual void SanitizeSavePackageResourceName(base::FilePath* filename) {} |
147 | 147 |
148 // Opens the file associated with this download. | 148 // Opens the file associated with this download. |
149 virtual void OpenDownload(DownloadItem* download) {} | 149 virtual void OpenDownload(DownloadItem* download) {} |
150 | 150 |
151 // Shows the download via the OS shell. | 151 // Shows the download via the OS shell. |
152 virtual void ShowDownloadInShell(DownloadItem* download) {} | 152 virtual void ShowDownloadInShell(DownloadItem* download) {} |
153 | 153 |
154 // Checks whether a downloaded file still exists. | 154 // Checks whether a downloaded file still exists. |
155 virtual void CheckForFileExistence( | 155 virtual void CheckForFileExistence(DownloadItem* download, |
156 DownloadItem* download, | 156 CheckForFileExistenceCallback callback) {} |
157 const CheckForFileExistenceCallback& callback) {} | |
158 | 157 |
159 // Return a GUID string used for identifying the application to the system AV | 158 // Return a GUID string used for identifying the application to the system AV |
160 // function for scanning downloaded files. If no GUID is provided or if the | 159 // function for scanning downloaded files. If no GUID is provided or if the |
161 // provided GUID is invalid, then the appropriate quarantining will be | 160 // provided GUID is invalid, then the appropriate quarantining will be |
162 // performed manually without passing the download to the system AV function. | 161 // performed manually without passing the download to the system AV function. |
163 // | 162 // |
164 // This GUID is only used on Windows. | 163 // This GUID is only used on Windows. |
165 virtual std::string ApplicationClientIdForFileScanning() const; | 164 virtual std::string ApplicationClientIdForFileScanning() const; |
166 | 165 |
167 protected: | 166 protected: |
168 virtual ~DownloadManagerDelegate(); | 167 virtual ~DownloadManagerDelegate(); |
169 }; | 168 }; |
170 | 169 |
171 } // namespace content | 170 } // namespace content |
172 | 171 |
173 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_DELEGATE_H_ | 172 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_DELEGATE_H_ |
OLD | NEW |