Chromium Code Reviews| 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 | |
| 158 virtual DownloadState GetState() const = 0; | 167 virtual DownloadState GetState() const = 0; |
|
svaldez
2016/03/14 16:59:50
Consider adding a comment here.
asanka
2016/03/14 19:18:33
Done.
| |
| 159 | 168 |
| 160 // Returns the most recent interrupt reason for this download. Returns | 169 // Returns the most recent interrupt reason for this download. Returns |
| 161 // DOWNLOAD_INTERRUPT_REASON_NONE if there is no previous interrupt reason. | 170 // DOWNLOAD_INTERRUPT_REASON_NONE if there is no previous interrupt reason. |
| 162 // Cancelled downloads return DOWNLOAD_INTERRUPT_REASON_USER_CANCELLED. If | 171 // Cancelled downloads return DOWNLOAD_INTERRUPT_REASON_USER_CANCELLED. If |
| 163 // the download was resumed, then the return value is the interrupt reason | 172 // the download was resumed, then the return value is the interrupt reason |
| 164 // prior to resumption. | 173 // prior to resumption. |
| 165 virtual DownloadInterruptReason GetLastReason() const = 0; | 174 virtual DownloadInterruptReason GetLastReason() const = 0; |
| 166 | 175 |
| 167 virtual bool IsPaused() const = 0; | 176 virtual bool IsPaused() const = 0; |
| 168 virtual bool IsTemporary() const = 0; | 177 virtual bool IsTemporary() const = 0; |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 331 // return |name|. Has no effect on the final target filename. | 340 // return |name|. Has no effect on the final target filename. |
| 332 virtual void SetDisplayName(const base::FilePath& name) = 0; | 341 virtual void SetDisplayName(const base::FilePath& name) = 0; |
| 333 | 342 |
| 334 // Debug/testing ------------------------------------------------------------- | 343 // Debug/testing ------------------------------------------------------------- |
| 335 virtual std::string DebugString(bool verbose) const = 0; | 344 virtual std::string DebugString(bool verbose) const = 0; |
| 336 }; | 345 }; |
| 337 | 346 |
| 338 } // namespace content | 347 } // namespace content |
| 339 | 348 |
| 340 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_ITEM_H_ | 349 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_ITEM_H_ |
| OLD | NEW |