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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 virtual std::string GetReferrerCharset() const = 0; | 197 virtual std::string GetReferrerCharset() const = 0; |
198 virtual std::string GetRemoteAddress() const = 0; | 198 virtual std::string GetRemoteAddress() const = 0; |
199 virtual bool HasUserGesture() const = 0; | 199 virtual bool HasUserGesture() const = 0; |
200 virtual PageTransition GetTransitionType() const = 0; | 200 virtual PageTransition GetTransitionType() const = 0; |
201 virtual const std::string& GetLastModifiedTime() const = 0; | 201 virtual const std::string& GetLastModifiedTime() const = 0; |
202 virtual const std::string& GetETag() const = 0; | 202 virtual const std::string& GetETag() const = 0; |
203 | 203 |
204 // Destination State accessors -------------------------------------------- | 204 // Destination State accessors -------------------------------------------- |
205 | 205 |
206 // Full path to the downloaded or downloading file. This is the path to the | 206 // Full path to the downloaded or downloading file. This is the path to the |
207 // physical file, if one exists. Can be empty if the in-progress path hasn't | 207 // physical file, if one exists. It should be considered a hint; changes to |
208 // been determined yet. | 208 // this value and renames of the file on disk are not atomic with each other. |
| 209 // May be empty if the in-progress path hasn't been determined yet. |
209 virtual const FilePath& GetFullPath() const = 0; | 210 virtual const FilePath& GetFullPath() const = 0; |
210 | 211 |
211 // Target path of an in-progress download. We may be downloading to a | 212 // Target path of an in-progress download. We may be downloading to a |
212 // temporary or intermediate file (specified by |current_path_|. Once the | 213 // temporary or intermediate file (specified by GetFullPath()); this is the |
213 // download completes, we will rename the file to |target_path_|. | 214 // name we will use once the download completes. |
| 215 // May be empty if the target path hasn't yet been determined. |
214 virtual const FilePath& GetTargetFilePath() const = 0; | 216 virtual const FilePath& GetTargetFilePath() const = 0; |
215 | 217 |
216 // |GetTargetFilePath().BaseName()| | 218 // |GetTargetFilePath().BaseName()| |
217 virtual FilePath GetTargetName() const = 0; | 219 virtual FilePath GetTargetName() const = 0; |
218 | 220 |
219 // If the download forced a path rather than requesting name determination, | 221 // If the download forced a path rather than requesting name determination, |
220 // return the path requested. | 222 // return the path requested. |
221 virtual const FilePath& GetForcedFilePath() const = 0; | 223 virtual const FilePath& GetForcedFilePath() const = 0; |
222 | 224 |
223 // Returns the user-verified target file path for the download. | 225 // Returns the user-verified target file path for the download. |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 virtual void SetDisplayName(const FilePath& name) = 0; | 338 virtual void SetDisplayName(const FilePath& name) = 0; |
337 | 339 |
338 // Debug/testing ------------------------------------------------------------- | 340 // Debug/testing ------------------------------------------------------------- |
339 virtual std::string DebugString(bool verbose) const = 0; | 341 virtual std::string DebugString(bool verbose) const = 0; |
340 virtual void MockDownloadOpenForTesting() = 0; | 342 virtual void MockDownloadOpenForTesting() = 0; |
341 }; | 343 }; |
342 | 344 |
343 } // namespace content | 345 } // namespace content |
344 | 346 |
345 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_ITEM_H_ | 347 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_ITEM_H_ |
OLD | NEW |