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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
163 virtual DownloadInterruptReason GetLastReason() const = 0; | 163 virtual DownloadInterruptReason GetLastReason() const = 0; |
164 | 164 |
165 virtual bool IsPaused() const = 0; | 165 virtual bool IsPaused() const = 0; |
166 virtual bool IsTemporary() const = 0; | 166 virtual bool IsTemporary() const = 0; |
167 | 167 |
168 // Returns true if the download can be resumed. A download can be resumed if | 168 // Returns true if the download can be resumed. A download can be resumed if |
169 // an in-progress download was paused or if an interrupted download requires | 169 // an in-progress download was paused or if an interrupted download requires |
170 // user-interaction to resume. | 170 // user-interaction to resume. |
171 virtual bool CanResume() const = 0; | 171 virtual bool CanResume() const = 0; |
172 | 172 |
173 // Returns true if the download is not in a terminal state. This includes | |
174 // in-progress downloads as well as interrupted downloads that are currently | |
175 // resuming or could be resumed. Cancelled or completed downloads are | |
176 // considered to be in a terminal state. | |
177 virtual bool IsPartialDownload() const = 0; | |
Randy Smith (Not in Mondays)
2013/06/05 20:21:44
Just raising the question: Do we want to keep this
asanka
2013/06/05 21:33:47
Changed to IsDone().
| |
178 | |
173 // Convenience routines for accessing GetState() results conceptually ----- | 179 // Convenience routines for accessing GetState() results conceptually ----- |
174 | 180 |
175 // Returns true if the download needs more data. | |
176 virtual bool IsPartialDownload() const = 0; | |
177 | |
178 // Returns true if the download is still receiving data. | 181 // Returns true if the download is still receiving data. |
179 virtual bool IsInProgress() const = 0; | 182 virtual bool IsInProgress() const = 0; |
180 | 183 |
181 // Returns true if the download has been cancelled or was interrupted. | 184 // Returns true if the download has been cancelled or was interrupted. |
182 virtual bool IsCancelled() const = 0; | 185 virtual bool IsCancelled() const = 0; |
183 | 186 |
184 // Returns true if the download was interrupted. | 187 // Returns true if the download was interrupted. |
185 virtual bool IsInterrupted() const = 0; | 188 virtual bool IsInterrupted() const = 0; |
186 | 189 |
187 // Returns true if we have all the data and know the final file name. | 190 // Returns true if we have all the data and know the final file name. |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
327 // return |name|. Has no effect on the final target filename. | 330 // return |name|. Has no effect on the final target filename. |
328 virtual void SetDisplayName(const base::FilePath& name) = 0; | 331 virtual void SetDisplayName(const base::FilePath& name) = 0; |
329 | 332 |
330 // Debug/testing ------------------------------------------------------------- | 333 // Debug/testing ------------------------------------------------------------- |
331 virtual std::string DebugString(bool verbose) const = 0; | 334 virtual std::string DebugString(bool verbose) const = 0; |
332 }; | 335 }; |
333 | 336 |
334 } // namespace content | 337 } // namespace content |
335 | 338 |
336 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_ITEM_H_ | 339 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_ITEM_H_ |
OLD | NEW |