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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 // GetState() != COMPLETED. | 228 // GetState() != COMPLETED. |
229 virtual const std::string& GetHash() const = 0; | 229 virtual const std::string& GetHash() const = 0; |
230 | 230 |
231 // Intermediate hash state, for persisting partial downloads. | 231 // Intermediate hash state, for persisting partial downloads. |
232 virtual const std::string& GetHashState() const = 0; | 232 virtual const std::string& GetHashState() const = 0; |
233 | 233 |
234 // True if the file associated with the download has been removed by | 234 // True if the file associated with the download has been removed by |
235 // external action. | 235 // external action. |
236 virtual bool GetFileExternallyRemoved() const = 0; | 236 virtual bool GetFileExternallyRemoved() const = 0; |
237 | 237 |
| 238 // If the file is successfully deleted, then GetFileExternallyRemoved() will |
| 239 // become true and DownloadItem::OnDownloadUpdated() will be called. Does |
| 240 // nothing if GetState() == COMPLETE or GetFileExternallyRemoved() is already |
| 241 // true. |
| 242 virtual void DeleteFile() = 0; |
| 243 |
238 // True if the file that will be written by the download is dangerous | 244 // True if the file that will be written by the download is dangerous |
239 // and we will require a call to ValidateDangerousDownload() to complete. | 245 // and we will require a call to ValidateDangerousDownload() to complete. |
240 // False if the download is safe or that function has been called. | 246 // False if the download is safe or that function has been called. |
241 virtual bool IsDangerous() const = 0; | 247 virtual bool IsDangerous() const = 0; |
242 | 248 |
243 // Why |safety_state_| is not SAFE. | 249 // Why |safety_state_| is not SAFE. |
244 virtual DownloadDangerType GetDangerType() const = 0; | 250 virtual DownloadDangerType GetDangerType() const = 0; |
245 | 251 |
246 // Progress State accessors ----------------------------------------------- | 252 // Progress State accessors ----------------------------------------------- |
247 | 253 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 // return |name|. Has no effect on the final target filename. | 321 // return |name|. Has no effect on the final target filename. |
316 virtual void SetDisplayName(const base::FilePath& name) = 0; | 322 virtual void SetDisplayName(const base::FilePath& name) = 0; |
317 | 323 |
318 // Debug/testing ------------------------------------------------------------- | 324 // Debug/testing ------------------------------------------------------------- |
319 virtual std::string DebugString(bool verbose) const = 0; | 325 virtual std::string DebugString(bool verbose) const = 0; |
320 }; | 326 }; |
321 | 327 |
322 } // namespace content | 328 } // namespace content |
323 | 329 |
324 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_ITEM_H_ | 330 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_ITEM_H_ |
OLD | NEW |