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_MANAGER_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_IMPL_H_ |
6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_IMPL_H_ | 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_IMPL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "content/public/browser/download_url_parameters.h" | 21 #include "content/public/browser/download_url_parameters.h" |
22 | 22 |
23 namespace net { | 23 namespace net { |
24 class BoundNetLog; | 24 class BoundNetLog; |
25 } | 25 } |
26 | 26 |
27 namespace content { | 27 namespace content { |
28 class DownloadFileFactory; | 28 class DownloadFileFactory; |
29 class DownloadItemFactory; | 29 class DownloadItemFactory; |
30 class DownloadItemImpl; | 30 class DownloadItemImpl; |
| 31 class DownloadRequestHandleInterface; |
31 | 32 |
32 class CONTENT_EXPORT DownloadManagerImpl : public DownloadManager, | 33 class CONTENT_EXPORT DownloadManagerImpl : public DownloadManager, |
33 private DownloadItemImplDelegate { | 34 private DownloadItemImplDelegate { |
34 public: | 35 public: |
35 // Caller guarantees that |net_log| will remain valid | 36 // Caller guarantees that |net_log| will remain valid |
36 // for the lifetime of DownloadManagerImpl (until Shutdown() is called). | 37 // for the lifetime of DownloadManagerImpl (until Shutdown() is called). |
37 DownloadManagerImpl(net::NetLog* net_log); | 38 DownloadManagerImpl(net::NetLog* net_log); |
38 | 39 |
39 // Implementation functions (not part of the DownloadManager interface). | 40 // Implementation functions (not part of the DownloadManager interface). |
40 | 41 |
41 // Creates a download item for the SavePackage system. | 42 // Creates a download item for the SavePackage system. |
42 // Must be called on the UI thread. Note that the DownloadManager | 43 // Must be called on the UI thread. Note that the DownloadManager |
43 // retains ownership. | 44 // retains ownership. |
44 virtual DownloadItemImpl* CreateSavePackageDownloadItem( | 45 virtual DownloadItemImpl* CreateSavePackageDownloadItem( |
45 const base::FilePath& main_file_path, | 46 const base::FilePath& main_file_path, |
46 const GURL& page_url, | 47 const GURL& page_url, |
47 const std::string& mime_type, | 48 const std::string& mime_type, |
| 49 scoped_ptr<DownloadRequestHandleInterface> request_handle, |
48 DownloadItem::Observer* observer); | 50 DownloadItem::Observer* observer); |
49 | 51 |
50 // Notifies DownloadManager about a successful completion of |download_item|. | 52 // Notifies DownloadManager about a successful completion of |download_item|. |
51 void OnSavePackageSuccessfullyFinished(DownloadItem* download_item); | 53 void OnSavePackageSuccessfullyFinished(DownloadItem* download_item); |
52 | 54 |
53 // DownloadManager functions. | 55 // DownloadManager functions. |
54 virtual void SetDelegate(DownloadManagerDelegate* delegate) OVERRIDE; | 56 virtual void SetDelegate(DownloadManagerDelegate* delegate) OVERRIDE; |
55 virtual DownloadManagerDelegate* GetDelegate() const OVERRIDE; | 57 virtual DownloadManagerDelegate* GetDelegate() const OVERRIDE; |
56 virtual void Shutdown() OVERRIDE; | 58 virtual void Shutdown() OVERRIDE; |
57 virtual void GetAllDownloads(DownloadVector* result) OVERRIDE; | 59 virtual void GetAllDownloads(DownloadVector* result) OVERRIDE; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 virtual bool ShouldOpenDownload( | 135 virtual bool ShouldOpenDownload( |
134 DownloadItemImpl* item, | 136 DownloadItemImpl* item, |
135 const ShouldOpenDownloadCallback& callback) OVERRIDE; | 137 const ShouldOpenDownloadCallback& callback) OVERRIDE; |
136 virtual void CheckForFileRemoval(DownloadItemImpl* download_item) OVERRIDE; | 138 virtual void CheckForFileRemoval(DownloadItemImpl* download_item) OVERRIDE; |
137 virtual void ResumeInterruptedDownload( | 139 virtual void ResumeInterruptedDownload( |
138 scoped_ptr<content::DownloadUrlParameters> params, | 140 scoped_ptr<content::DownloadUrlParameters> params, |
139 content::DownloadId id) OVERRIDE; | 141 content::DownloadId id) OVERRIDE; |
140 virtual void OpenDownload(DownloadItemImpl* download) OVERRIDE; | 142 virtual void OpenDownload(DownloadItemImpl* download) OVERRIDE; |
141 virtual void ShowDownloadInShell(DownloadItemImpl* download) OVERRIDE; | 143 virtual void ShowDownloadInShell(DownloadItemImpl* download) OVERRIDE; |
142 virtual void DownloadRemoved(DownloadItemImpl* download) OVERRIDE; | 144 virtual void DownloadRemoved(DownloadItemImpl* download) OVERRIDE; |
143 virtual void ShowDownloadInBrowser(DownloadItemImpl* download) OVERRIDE; | |
144 | 145 |
145 // Factory for creation of downloads items. | 146 // Factory for creation of downloads items. |
146 scoped_ptr<DownloadItemFactory> item_factory_; | 147 scoped_ptr<DownloadItemFactory> item_factory_; |
147 | 148 |
148 // Factory for the creation of download files. | 149 // Factory for the creation of download files. |
149 scoped_ptr<DownloadFileFactory> file_factory_; | 150 scoped_ptr<DownloadFileFactory> file_factory_; |
150 | 151 |
151 // |downloads_| is the owning set for all downloads known to the | 152 // |downloads_| is the owning set for all downloads known to the |
152 // DownloadManager. This includes downloads started by the user in | 153 // DownloadManager. This includes downloads started by the user in |
153 // this session, downloads initialized from the history system, and | 154 // this session, downloads initialized from the history system, and |
(...skipping 15 matching lines...) Expand all Loading... |
169 DownloadManagerDelegate* delegate_; | 170 DownloadManagerDelegate* delegate_; |
170 | 171 |
171 net::NetLog* net_log_; | 172 net::NetLog* net_log_; |
172 | 173 |
173 DISALLOW_COPY_AND_ASSIGN(DownloadManagerImpl); | 174 DISALLOW_COPY_AND_ASSIGN(DownloadManagerImpl); |
174 }; | 175 }; |
175 | 176 |
176 } // namespace content | 177 } // namespace content |
177 | 178 |
178 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_IMPL_H_ | 179 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_IMPL_H_ |
OLD | NEW |