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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 | 147 |
148 // Open the file associated with this download. If the download is | 148 // Open the file associated with this download. If the download is |
149 // still in progress, marks the download to be opened when it is complete. | 149 // still in progress, marks the download to be opened when it is complete. |
150 virtual void OpenDownload() = 0; | 150 virtual void OpenDownload() = 0; |
151 | 151 |
152 // Show the download via the OS shell. | 152 // Show the download via the OS shell. |
153 virtual void ShowDownloadInShell() = 0; | 153 virtual void ShowDownloadInShell() = 0; |
154 | 154 |
155 // State accessors ----------------------------------------------------------- | 155 // State accessors ----------------------------------------------------------- |
156 | 156 |
| 157 // Retrieve the ID for this download. The ID is provided by the owner of the |
| 158 // DownloadItem and is expected to uniquely identify the download within the |
| 159 // context of its container during the lifetime of the download. |
157 virtual uint32_t GetId() const = 0; | 160 virtual uint32_t GetId() const = 0; |
| 161 |
| 162 // Retrieve the GUID for this download. The returned string is never empty and |
| 163 // will satisfy base::IsValidGUID(), in addition to uniquely identifying the |
| 164 // download during its lifetime regardless of its container. |
| 165 virtual const std::string& GetGuid() const = 0; |
| 166 |
| 167 // Get the current state of the download. See DownloadState for descriptions |
| 168 // of each download state. |
158 virtual DownloadState GetState() const = 0; | 169 virtual DownloadState GetState() const = 0; |
159 | 170 |
160 // Returns the most recent interrupt reason for this download. Returns | 171 // Returns the most recent interrupt reason for this download. Returns |
161 // DOWNLOAD_INTERRUPT_REASON_NONE if there is no previous interrupt reason. | 172 // DOWNLOAD_INTERRUPT_REASON_NONE if there is no previous interrupt reason. |
162 // Cancelled downloads return DOWNLOAD_INTERRUPT_REASON_USER_CANCELLED. If | 173 // Cancelled downloads return DOWNLOAD_INTERRUPT_REASON_USER_CANCELLED. If |
163 // the download was resumed, then the return value is the interrupt reason | 174 // the download was resumed, then the return value is the interrupt reason |
164 // prior to resumption. | 175 // prior to resumption. |
165 virtual DownloadInterruptReason GetLastReason() const = 0; | 176 virtual DownloadInterruptReason GetLastReason() const = 0; |
166 | 177 |
167 virtual bool IsPaused() const = 0; | 178 virtual bool IsPaused() const = 0; |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 // return |name|. Has no effect on the final target filename. | 342 // return |name|. Has no effect on the final target filename. |
332 virtual void SetDisplayName(const base::FilePath& name) = 0; | 343 virtual void SetDisplayName(const base::FilePath& name) = 0; |
333 | 344 |
334 // Debug/testing ------------------------------------------------------------- | 345 // Debug/testing ------------------------------------------------------------- |
335 virtual std::string DebugString(bool verbose) const = 0; | 346 virtual std::string DebugString(bool verbose) const = 0; |
336 }; | 347 }; |
337 | 348 |
338 } // namespace content | 349 } // namespace content |
339 | 350 |
340 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_ITEM_H_ | 351 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_ITEM_H_ |
OLD | NEW |