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 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ |
6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ | 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 // to OnDownloadedFileRemoved(). | 55 // to OnDownloadedFileRemoved(). |
56 virtual void CheckForFileRemoval(DownloadItem* download_item) = 0; | 56 virtual void CheckForFileRemoval(DownloadItem* download_item) = 0; |
57 | 57 |
58 // If all pre-requisites have been met, complete download processing. | 58 // If all pre-requisites have been met, complete download processing. |
59 // TODO(rdsmith): Move into DownloadItem. | 59 // TODO(rdsmith): Move into DownloadItem. |
60 virtual void MaybeCompleteDownload(DownloadItem* download) = 0; | 60 virtual void MaybeCompleteDownload(DownloadItem* download) = 0; |
61 | 61 |
62 // For contextual issues like language and prefs. | 62 // For contextual issues like language and prefs. |
63 virtual content::BrowserContext* GetBrowserContext() const = 0; | 63 virtual content::BrowserContext* GetBrowserContext() const = 0; |
64 | 64 |
| 65 // Get the DownloadFileManager to use for this download. |
| 66 virtual DownloadFileManager* GetDownloadFileManager() = 0; |
| 67 |
65 // Handle any delegate portions of a state change operation on the | 68 // Handle any delegate portions of a state change operation on the |
66 // DownloadItem. | 69 // DownloadItem. |
67 virtual void DownloadStopped(DownloadItem* download) = 0; | 70 virtual void DownloadStopped(DownloadItem* download) = 0; |
68 virtual void DownloadCompleted(DownloadItem* download) = 0; | 71 virtual void DownloadCompleted(DownloadItem* download) = 0; |
69 virtual void DownloadOpened(DownloadItem* download) = 0; | 72 virtual void DownloadOpened(DownloadItem* download) = 0; |
70 virtual void DownloadRemoved(DownloadItem* download) = 0; | 73 virtual void DownloadRemoved(DownloadItem* download) = 0; |
71 virtual void DownloadRenamedToIntermediateName(DownloadItem* download) = 0; | 74 virtual void DownloadRenamedToIntermediateName(DownloadItem* download) = 0; |
72 virtual void DownloadRenamedToFinalName(DownloadItem* download) = 0; | 75 virtual void DownloadRenamedToFinalName(DownloadItem* download) = 0; |
73 | 76 |
74 // Assert consistent state for delgate object at various transitions. | 77 // Assert consistent state for delgate object at various transitions. |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 virtual bool MatchesQuery(const string16& query) const OVERRIDE; | 147 virtual bool MatchesQuery(const string16& query) const OVERRIDE; |
145 virtual bool IsPartialDownload() const OVERRIDE; | 148 virtual bool IsPartialDownload() const OVERRIDE; |
146 virtual bool IsInProgress() const OVERRIDE; | 149 virtual bool IsInProgress() const OVERRIDE; |
147 virtual bool IsCancelled() const OVERRIDE; | 150 virtual bool IsCancelled() const OVERRIDE; |
148 virtual bool IsInterrupted() const OVERRIDE; | 151 virtual bool IsInterrupted() const OVERRIDE; |
149 virtual bool IsComplete() const OVERRIDE; | 152 virtual bool IsComplete() const OVERRIDE; |
150 virtual DownloadState GetState() const OVERRIDE; | 153 virtual DownloadState GetState() const OVERRIDE; |
151 virtual const FilePath& GetFullPath() const OVERRIDE; | 154 virtual const FilePath& GetFullPath() const OVERRIDE; |
152 virtual const FilePath& GetTargetFilePath() const OVERRIDE; | 155 virtual const FilePath& GetTargetFilePath() const OVERRIDE; |
153 virtual TargetDisposition GetTargetDisposition() const OVERRIDE; | 156 virtual TargetDisposition GetTargetDisposition() const OVERRIDE; |
154 virtual void OnTargetPathDetermined( | 157 virtual void OnDownloadTargetDetermined( |
155 const FilePath& target_path, | 158 const FilePath& target_path, |
156 TargetDisposition disposition, | 159 TargetDisposition disposition, |
157 content::DownloadDangerType danger_type) OVERRIDE; | 160 content::DownloadDangerType danger_type, |
158 virtual void OnTargetPathSelected(const FilePath& target_path) OVERRIDE; | 161 const FilePath& intermediate_path) OVERRIDE; |
159 virtual void OnContentCheckCompleted( | 162 virtual void OnContentCheckCompleted( |
160 content::DownloadDangerType danger_type) OVERRIDE; | 163 content::DownloadDangerType danger_type) OVERRIDE; |
161 virtual void OnIntermediatePathDetermined(DownloadFileManager* file_manager, | |
162 const FilePath& path) OVERRIDE; | |
163 virtual const GURL& GetURL() const OVERRIDE; | 164 virtual const GURL& GetURL() const OVERRIDE; |
164 virtual const std::vector<GURL>& GetUrlChain() const OVERRIDE; | 165 virtual const std::vector<GURL>& GetUrlChain() const OVERRIDE; |
165 virtual const GURL& GetOriginalUrl() const OVERRIDE; | 166 virtual const GURL& GetOriginalUrl() const OVERRIDE; |
166 virtual const GURL& GetReferrerUrl() const OVERRIDE; | 167 virtual const GURL& GetReferrerUrl() const OVERRIDE; |
167 virtual std::string GetSuggestedFilename() const OVERRIDE; | 168 virtual std::string GetSuggestedFilename() const OVERRIDE; |
168 virtual std::string GetContentDisposition() const OVERRIDE; | 169 virtual std::string GetContentDisposition() const OVERRIDE; |
169 virtual std::string GetMimeType() const OVERRIDE; | 170 virtual std::string GetMimeType() const OVERRIDE; |
170 virtual std::string GetOriginalMimeType() const OVERRIDE; | 171 virtual std::string GetOriginalMimeType() const OVERRIDE; |
171 virtual std::string GetReferrerCharset() const OVERRIDE; | 172 virtual std::string GetReferrerCharset() const OVERRIDE; |
172 virtual std::string GetRemoteAddress() const OVERRIDE; | 173 virtual std::string GetRemoteAddress() const OVERRIDE; |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 | 428 |
428 // Net log to use for this download. | 429 // Net log to use for this download. |
429 const net::BoundNetLog bound_net_log_; | 430 const net::BoundNetLog bound_net_log_; |
430 | 431 |
431 base::WeakPtrFactory<DownloadItemImpl> weak_ptr_factory_; | 432 base::WeakPtrFactory<DownloadItemImpl> weak_ptr_factory_; |
432 | 433 |
433 DISALLOW_COPY_AND_ASSIGN(DownloadItemImpl); | 434 DISALLOW_COPY_AND_ASSIGN(DownloadItemImpl); |
434 }; | 435 }; |
435 | 436 |
436 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ | 437 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ |
OLD | NEW |