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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 virtual void DangerousDownloadValidated() = 0; | 120 virtual void DangerousDownloadValidated() = 0; |
121 | 121 |
122 // Pause a download. Will have no effect if the download is already | 122 // Pause a download. Will have no effect if the download is already |
123 // paused. | 123 // paused. |
124 virtual void Pause() = 0; | 124 virtual void Pause() = 0; |
125 | 125 |
126 // Resume a download. Will have no effect if the download is not | 126 // Resume a download. Will have no effect if the download is not |
127 // paused. | 127 // paused. |
128 virtual void Resume() = 0; | 128 virtual void Resume() = 0; |
129 | 129 |
| 130 // Resume a download that's been interrupted. |
| 131 virtual void ResumeInterruptedDownload() = 0; |
| 132 |
130 // Cancel the download operation. We need to distinguish between cancels at | 133 // Cancel the download operation. We need to distinguish between cancels at |
131 // exit (DownloadManager destructor) from user interface initiated cancels | 134 // exit (DownloadManager destructor) from user interface initiated cancels |
132 // because at exit, the history system may not exist, and any updates to it | 135 // because at exit, the history system may not exist, and any updates to it |
133 // require AddRef'ing the DownloadManager in the destructor which results in | 136 // require AddRef'ing the DownloadManager in the destructor which results in |
134 // a DCHECK failure. Set |user_cancel| to false when canceling from at | 137 // a DCHECK failure. Set |user_cancel| to false when canceling from at |
135 // exit to prevent this crash. This may result in a difference between the | 138 // exit to prevent this crash. This may result in a difference between the |
136 // downloaded file's size on disk, and what the history system's last record | 139 // downloaded file's size on disk, and what the history system's last record |
137 // of it is. At worst, we'll end up re-downloading a small portion of the file | 140 // of it is. At worst, we'll end up re-downloading a small portion of the file |
138 // when resuming a download (assuming the server supports byte ranges). | 141 // when resuming a download (assuming the server supports byte ranges). |
139 virtual void Cancel(bool user_cancel) = 0; | 142 virtual void Cancel(bool user_cancel) = 0; |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 virtual void SetDisplayName(const FilePath& name) = 0; | 327 virtual void SetDisplayName(const FilePath& name) = 0; |
325 | 328 |
326 // Debug/testing ------------------------------------------------------------- | 329 // Debug/testing ------------------------------------------------------------- |
327 virtual std::string DebugString(bool verbose) const = 0; | 330 virtual std::string DebugString(bool verbose) const = 0; |
328 virtual void MockDownloadOpenForTesting() = 0; | 331 virtual void MockDownloadOpenForTesting() = 0; |
329 }; | 332 }; |
330 | 333 |
331 } // namespace content | 334 } // namespace content |
332 | 335 |
333 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_ITEM_H_ | 336 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_ITEM_H_ |
OLD | NEW |