| 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 // The DownloadItemFactory is used to produce different DownloadItems. | 5 // The DownloadItemFactory is used to produce different DownloadItems. |
| 6 // It is separate from the DownloadManager to allow download manager | 6 // It is separate from the DownloadManager to allow download manager |
| 7 // unit tests to control the items produced. | 7 // unit tests to control the items produced. |
| 8 | 8 |
| 9 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_FACTORY_H_ | 9 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_FACTORY_H_ |
| 10 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_FACTORY_H_ | 10 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_FACTORY_H_ |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 class DownloadRequestHandleInterface; | 30 class DownloadRequestHandleInterface; |
| 31 struct DownloadCreateInfo; | 31 struct DownloadCreateInfo; |
| 32 | 32 |
| 33 class DownloadItemFactory { | 33 class DownloadItemFactory { |
| 34 public: | 34 public: |
| 35 virtual ~DownloadItemFactory() {} | 35 virtual ~DownloadItemFactory() {} |
| 36 | 36 |
| 37 virtual DownloadItemImpl* CreatePersistedItem( | 37 virtual DownloadItemImpl* CreatePersistedItem( |
| 38 DownloadItemImplDelegate* delegate, | 38 DownloadItemImplDelegate* delegate, |
| 39 DownloadId download_id, | 39 DownloadId download_id, |
| 40 const FilePath& path, | 40 const FilePath& current_path, |
| 41 const GURL& url, | 41 const FilePath& target_path, |
| 42 const std::vector<GURL>& url_chain, |
| 42 const GURL& referrer_url, | 43 const GURL& referrer_url, |
| 43 const base::Time& start_time, | 44 const base::Time& start_time, |
| 44 const base::Time& end_time, | 45 const base::Time& end_time, |
| 45 int64 received_bytes, | 46 int64 received_bytes, |
| 46 int64 total_bytes, | 47 int64 total_bytes, |
| 47 content::DownloadItem::DownloadState state, | 48 DownloadItem::DownloadState state, |
| 49 DownloadInterruptReason interrupt_reason, |
| 48 bool opened, | 50 bool opened, |
| 49 const net::BoundNetLog& bound_net_log) = 0; | 51 const net::BoundNetLog& bound_net_log) = 0; |
| 50 | 52 |
| 51 virtual DownloadItemImpl* CreateActiveItem( | 53 virtual DownloadItemImpl* CreateActiveItem( |
| 52 DownloadItemImplDelegate* delegate, | 54 DownloadItemImplDelegate* delegate, |
| 53 const DownloadCreateInfo& info, | 55 const DownloadCreateInfo& info, |
| 54 scoped_ptr<DownloadRequestHandleInterface> request_handle, | 56 scoped_ptr<DownloadRequestHandleInterface> request_handle, |
| 55 const net::BoundNetLog& bound_net_log) = 0; | 57 const net::BoundNetLog& bound_net_log) = 0; |
| 56 | 58 |
| 57 virtual DownloadItemImpl* CreateSavePageItem( | 59 virtual DownloadItemImpl* CreateSavePageItem( |
| 58 DownloadItemImplDelegate* delegate, | 60 DownloadItemImplDelegate* delegate, |
| 59 const FilePath& path, | 61 const FilePath& path, |
| 60 const GURL& url, | 62 const GURL& url, |
| 61 DownloadId download_id, | 63 DownloadId download_id, |
| 62 const std::string& mime_type, | 64 const std::string& mime_type, |
| 63 const net::BoundNetLog& bound_net_log) = 0; | 65 const net::BoundNetLog& bound_net_log) = 0; |
| 64 }; | 66 }; |
| 65 | 67 |
| 66 } // namespace content | 68 } // namespace content |
| 67 | 69 |
| 68 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_FACTORY_H_ | 70 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_FACTORY_H_ |
| OLD | NEW |