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 // Each download is represented by a DownloadItem, and all DownloadItems | 5 // Each download is represented by a DownloadItem, and all DownloadItems |
6 // are owned by the DownloadManager which maintains a global list of all | 6 // are owned by the DownloadManager which maintains a global list of all |
7 // downloads. DownloadItems are created when a user initiates a download, | 7 // downloads. DownloadItems are created when a user initiates a download, |
8 // and exist for the duration of the browser life time. | 8 // and exist for the duration of the browser life time. |
9 // | 9 // |
10 // Download observers: | 10 // Download observers: |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 // Called by the delegate after it delayed opening the download in | 164 // Called by the delegate after it delayed opening the download in |
165 // DownloadManagerDelegate::ShouldOpenDownload. | 165 // DownloadManagerDelegate::ShouldOpenDownload. |
166 virtual void DelayedDownloadOpened() = 0; | 166 virtual void DelayedDownloadOpened() = 0; |
167 | 167 |
168 // Called when all data has been saved. Only has display effects. | 168 // Called when all data has been saved. Only has display effects. |
169 virtual void OnAllDataSaved(int64 size, const std::string& final_hash) = 0; | 169 virtual void OnAllDataSaved(int64 size, const std::string& final_hash) = 0; |
170 | 170 |
171 // Called when the downloaded file is removed. | 171 // Called when the downloaded file is removed. |
172 virtual void OnDownloadedFileRemoved() = 0; | 172 virtual void OnDownloadedFileRemoved() = 0; |
173 | 173 |
174 // If all pre-requisites have been met, complete download processing, i.e. | |
175 // do internal cleanup, file rename, and potentially auto-open. | |
176 // (Dangerous downloads still may block on user acceptance after this | |
177 // point.) | |
178 virtual void MaybeCompleteDownload() = 0; | |
179 | |
180 // Download operation had an error. | 174 // Download operation had an error. |
181 // |size| is the amount of data received at interruption. | 175 // |size| is the amount of data received at interruption. |
182 // |hash_state| is the current hash state at interruption. | 176 // |hash_state| is the current hash state at interruption. |
183 // |reason| is the download interrupt reason code that the operation received. | 177 // |reason| is the download interrupt reason code that the operation received. |
184 virtual void Interrupted(int64 size, | 178 virtual void Interrupted(int64 size, |
185 const std::string& hash_state, | 179 const std::string& hash_state, |
186 DownloadInterruptReason reason) = 0; | 180 DownloadInterruptReason reason) = 0; |
187 | 181 |
188 // Deletes the file from disk and removes the download from the views and | 182 // Deletes the file from disk and removes the download from the views and |
189 // history. |user| should be true if this is the result of the user clicking | 183 // history. |user| should be true if this is the result of the user clicking |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 virtual void SetExternalData(const void* key, ExternalData* data) = 0; | 348 virtual void SetExternalData(const void* key, ExternalData* data) = 0; |
355 | 349 |
356 virtual std::string DebugString(bool verbose) const = 0; | 350 virtual std::string DebugString(bool verbose) const = 0; |
357 | 351 |
358 virtual void MockDownloadOpenForTesting() = 0; | 352 virtual void MockDownloadOpenForTesting() = 0; |
359 }; | 353 }; |
360 | 354 |
361 } // namespace content | 355 } // namespace content |
362 | 356 |
363 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_ITEM_H_ | 357 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_ITEM_H_ |
OLD | NEW |