OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 // exit to prevent this crash. This may result in a difference between the | 167 // exit to prevent this crash. This may result in a difference between the |
168 // downloaded file's size on disk, and what the history system's last record | 168 // downloaded file's size on disk, and what the history system's last record |
169 // of it is. At worst, we'll end up re-downloading a small portion of the file | 169 // of it is. At worst, we'll end up re-downloading a small portion of the file |
170 // when resuming a download (assuming the server supports byte ranges). | 170 // when resuming a download (assuming the server supports byte ranges). |
171 void Cancel(bool user_cancel); | 171 void Cancel(bool user_cancel); |
172 | 172 |
173 // Called by external code (SavePackage) using the DownloadItem interface | 173 // Called by external code (SavePackage) using the DownloadItem interface |
174 // to display progress when the DownloadItem should be considered complete. | 174 // to display progress when the DownloadItem should be considered complete. |
175 void MarkAsComplete(); | 175 void MarkAsComplete(); |
176 | 176 |
177 // Called by the delegate after it delayed completing the download in | 177 // Called by the delegate after it delayed opening the download in |
178 // DownloadManagerDelegate::ShouldCompleteDownload. | 178 // DownloadManagerDelegate::ShouldOpenDownload. |
179 void CompleteDelayedDownload(); | 179 void DelayedDownloadOpened(); |
180 | 180 |
181 // Called when all data has been saved. Only has display effects. | 181 // Called when all data has been saved. Only has display effects. |
182 void OnAllDataSaved(int64 size); | 182 void OnAllDataSaved(int64 size); |
183 | 183 |
184 // Called when the downloaded file is removed. | 184 // Called when the downloaded file is removed. |
185 void OnDownloadedFileRemoved(); | 185 void OnDownloadedFileRemoved(); |
186 | 186 |
187 // Download operation had an error. | 187 // Download operation had an error. |
188 // |size| is the amount of data received at interruption. | 188 // |size| is the amount of data received at interruption. |
189 // |reason| is the download interrupt reason code that the operation received. | 189 // |reason| is the download interrupt reason code that the operation received. |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 // only. | 483 // only. |
484 bool open_enabled_; | 484 bool open_enabled_; |
485 | 485 |
486 // Did the delegate delay calling Complete on this download? | 486 // Did the delegate delay calling Complete on this download? |
487 bool delegate_delayed_complete_; | 487 bool delegate_delayed_complete_; |
488 | 488 |
489 DISALLOW_COPY_AND_ASSIGN(DownloadItem); | 489 DISALLOW_COPY_AND_ASSIGN(DownloadItem); |
490 }; | 490 }; |
491 | 491 |
492 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_H_ | 492 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_H_ |
OLD | NEW |