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_ |
11 | 11 |
12 #include <string> | 12 #include <string> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "content/public/browser/download_item.h" | 16 #include "content/public/browser/download_item.h" |
17 | 17 |
18 class GURL; | 18 class GURL; |
19 | 19 |
20 namespace base { | 20 namespace base { |
21 class FilePath; | 21 class FilePath; |
22 } | 22 } |
23 | 23 |
24 namespace net { | 24 namespace net { |
25 class BoundNetLog; | 25 class BoundNetLog; |
26 } | 26 } |
27 | 27 |
28 namespace content { | 28 namespace content { |
29 | 29 |
30 class DownloadItem; | |
31 class DownloadItemImpl; | 30 class DownloadItemImpl; |
32 class DownloadItemImplDelegate; | 31 class DownloadItemImplDelegate; |
33 class DownloadRequestHandleInterface; | 32 class DownloadRequestHandle; |
34 struct DownloadCreateInfo; | 33 struct DownloadCreateInfo; |
35 | 34 |
36 class DownloadItemFactory { | 35 class DownloadItemFactory { |
37 public: | 36 public: |
38 virtual ~DownloadItemFactory() {} | 37 virtual ~DownloadItemFactory() {} |
39 | 38 |
40 virtual DownloadItemImpl* CreatePersistedItem( | 39 virtual DownloadItemImpl* CreatePersistedItem( |
41 DownloadItemImplDelegate* delegate, | 40 DownloadItemImplDelegate* delegate, |
42 uint32 download_id, | 41 uint32 download_id, |
43 const base::FilePath& current_path, | 42 const base::FilePath& current_path, |
(...skipping 10 matching lines...) Expand all Loading... |
54 DownloadDangerType danger_type, | 53 DownloadDangerType danger_type, |
55 DownloadInterruptReason interrupt_reason, | 54 DownloadInterruptReason interrupt_reason, |
56 bool opened, | 55 bool opened, |
57 const net::BoundNetLog& bound_net_log) = 0; | 56 const net::BoundNetLog& bound_net_log) = 0; |
58 | 57 |
59 virtual DownloadItemImpl* CreateActiveItem( | 58 virtual DownloadItemImpl* CreateActiveItem( |
60 DownloadItemImplDelegate* delegate, | 59 DownloadItemImplDelegate* delegate, |
61 uint32 download_id, | 60 uint32 download_id, |
62 const DownloadCreateInfo& info, | 61 const DownloadCreateInfo& info, |
63 const net::BoundNetLog& bound_net_log) = 0; | 62 const net::BoundNetLog& bound_net_log) = 0; |
64 | |
65 virtual DownloadItemImpl* CreateSavePageItem( | |
66 DownloadItemImplDelegate* delegate, | |
67 uint32 download_id, | |
68 const base::FilePath& path, | |
69 const GURL& url, | |
70 const std::string& mime_type, | |
71 scoped_ptr<DownloadRequestHandleInterface> request_handle, | |
72 const net::BoundNetLog& bound_net_log) = 0; | |
73 }; | 63 }; |
74 | 64 |
75 } // namespace content | 65 } // namespace content |
76 | 66 |
77 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_FACTORY_H_ | 67 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_FACTORY_H_ |
OLD | NEW |