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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 | 148 |
149 // Show the download via the OS shell. | 149 // Show the download via the OS shell. |
150 virtual void ShowDownloadInShell() = 0; | 150 virtual void ShowDownloadInShell() = 0; |
151 | 151 |
152 // State accessors ----------------------------------------------------------- | 152 // State accessors ----------------------------------------------------------- |
153 | 153 |
154 virtual int32 GetId() const = 0; | 154 virtual int32 GetId() const = 0; |
155 virtual DownloadId GetGlobalId() const = 0; | 155 virtual DownloadId GetGlobalId() const = 0; |
156 virtual DownloadState GetState() const = 0; | 156 virtual DownloadState GetState() const = 0; |
157 | 157 |
158 // Only valid if |GetState() == DownloadItem::INTERRUPTED|. | 158 // Returns the most recent interrupt reason for this download. Returns |
| 159 // DOWNLOAD_INTERRUPT_REASON_NONE if there is no previous interrupt reason. |
| 160 // Cancelled downloads return DOWNLOAD_INTERRUPT_REASON_USER_CANCELLED. If |
| 161 // the download was resumed, then the return value is the interrupt reason |
| 162 // prior to resumption. |
159 virtual DownloadInterruptReason GetLastReason() const = 0; | 163 virtual DownloadInterruptReason GetLastReason() const = 0; |
160 | 164 |
161 virtual bool IsPaused() const = 0; | 165 virtual bool IsPaused() const = 0; |
162 virtual bool IsTemporary() const = 0; | 166 virtual bool IsTemporary() const = 0; |
163 | 167 |
164 // 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 |
165 // 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 |
166 // user-interaction to resume. | 170 // user-interaction to resume. |
167 virtual bool CanResume() const = 0; | 171 virtual bool CanResume() const = 0; |
168 | 172 |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 // return |name|. Has no effect on the final target filename. | 327 // return |name|. Has no effect on the final target filename. |
324 virtual void SetDisplayName(const base::FilePath& name) = 0; | 328 virtual void SetDisplayName(const base::FilePath& name) = 0; |
325 | 329 |
326 // Debug/testing ------------------------------------------------------------- | 330 // Debug/testing ------------------------------------------------------------- |
327 virtual std::string DebugString(bool verbose) const = 0; | 331 virtual std::string DebugString(bool verbose) const = 0; |
328 }; | 332 }; |
329 | 333 |
330 } // namespace content | 334 } // namespace content |
331 | 335 |
332 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_ITEM_H_ | 336 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_ITEM_H_ |
OLD | NEW |