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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 275 // Target path of an in-progress download. We may be downloading to a | 275 // Target path of an in-progress download. We may be downloading to a |
| 276 // temporary or intermediate file (specified by GetFullPath()); this is the | 276 // temporary or intermediate file (specified by GetFullPath()); this is the |
| 277 // name we will use once the download completes. | 277 // name we will use once the download completes. |
| 278 // May be empty if the target path hasn't yet been determined. | 278 // May be empty if the target path hasn't yet been determined. |
| 279 virtual const base::FilePath& GetTargetFilePath() const = 0; | 279 virtual const base::FilePath& GetTargetFilePath() const = 0; |
| 280 | 280 |
| 281 // If the download forced a path rather than requesting name determination, | 281 // If the download forced a path rather than requesting name determination, |
| 282 // return the path requested. | 282 // return the path requested. |
| 283 virtual const base::FilePath& GetForcedFilePath() const = 0; | 283 virtual const base::FilePath& GetForcedFilePath() const = 0; |
| 284 | 284 |
| 285 // Get the target path that was used most recently. It could be either the | |
| 286 // forced file path, or the target file path, if any one of them is provided. | |
| 287 virtual base::FilePath GetLastUsedTargetPath() const { | |
|
asanka
2017/01/10 19:34:19
= 0. But then again we shouldn't have this method
qinmin
2017/01/10 22:06:29
Done.
| |
| 288 return base::FilePath(); | |
| 289 } | |
| 290 | |
| 285 // Returns the file-name that should be reported to the user. If a display | 291 // Returns the file-name that should be reported to the user. If a display |
| 286 // name has been explicitly set using SetDisplayName(), this function returns | 292 // name has been explicitly set using SetDisplayName(), this function returns |
| 287 // that display name. Otherwise returns the final target filename. | 293 // that display name. Otherwise returns the final target filename. |
| 288 virtual base::FilePath GetFileNameToReportUser() const = 0; | 294 virtual base::FilePath GetFileNameToReportUser() const = 0; |
| 289 | 295 |
| 290 // See TargetDisposition. | 296 // See TargetDisposition. |
| 291 virtual TargetDisposition GetTargetDisposition() const = 0; | 297 virtual TargetDisposition GetTargetDisposition() const = 0; |
| 292 | 298 |
| 293 // Final hash of completely downloaded file, or partial hash of an interrupted | 299 // Final hash of completely downloaded file, or partial hash of an interrupted |
| 294 // download; only valid if GetState() == COMPLETED or INTERRUPTED. If | 300 // download; only valid if GetState() == COMPLETED or INTERRUPTED. If |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 408 // return |name|. Has no effect on the final target filename. | 414 // return |name|. Has no effect on the final target filename. |
| 409 virtual void SetDisplayName(const base::FilePath& name) = 0; | 415 virtual void SetDisplayName(const base::FilePath& name) = 0; |
| 410 | 416 |
| 411 // Debug/testing ------------------------------------------------------------- | 417 // Debug/testing ------------------------------------------------------------- |
| 412 virtual std::string DebugString(bool verbose) const = 0; | 418 virtual std::string DebugString(bool verbose) const = 0; |
| 413 }; | 419 }; |
| 414 | 420 |
| 415 } // namespace content | 421 } // namespace content |
| 416 | 422 |
| 417 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_ITEM_H_ | 423 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_ITEM_H_ |
| OLD | NEW |