Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Side by Side Diff: content/browser/download/download_item_factory.h

Issue 10915180: Make DownloadHistory observe manager, items (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: @r168573 Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 13
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "content/public/browser/download_id.h" 15 #include "content/public/browser/download_id.h"
16 #include "content/public/browser/download_item.h"
16 17
17 class FilePath; 18 class FilePath;
18 class GURL; 19 class GURL;
19 20
20 namespace net { 21 namespace net {
21 class BoundNetLog; 22 class BoundNetLog;
22 } 23 }
23 24
24 namespace content { 25 namespace content {
25 26
26 class DownloadItem; 27 class DownloadItem;
27 class DownloadItemImpl; 28 class DownloadItemImpl;
28 class DownloadItemImplDelegate; 29 class DownloadItemImplDelegate;
29 class DownloadRequestHandleInterface; 30 class DownloadRequestHandleInterface;
30 struct DownloadCreateInfo; 31 struct DownloadCreateInfo;
31 struct DownloadPersistentStoreInfo;
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 DownloadPersistentStoreInfo& info, 40 const FilePath& path,
41 const GURL& url,
42 const GURL& referrer_url,
43 const base::Time& start_time,
44 const base::Time& end_time,
45 int64 received_bytes,
46 int64 total_bytes,
47 content::DownloadItem::DownloadState state,
48 bool opened,
41 const net::BoundNetLog& bound_net_log) = 0; 49 const net::BoundNetLog& bound_net_log) = 0;
42 50
43 virtual DownloadItemImpl* CreateActiveItem( 51 virtual DownloadItemImpl* CreateActiveItem(
44 DownloadItemImplDelegate* delegate, 52 DownloadItemImplDelegate* delegate,
45 const DownloadCreateInfo& info, 53 const DownloadCreateInfo& info,
46 scoped_ptr<DownloadRequestHandleInterface> request_handle, 54 scoped_ptr<DownloadRequestHandleInterface> request_handle,
47 const net::BoundNetLog& bound_net_log) = 0; 55 const net::BoundNetLog& bound_net_log) = 0;
48 56
49 virtual DownloadItemImpl* CreateSavePageItem( 57 virtual DownloadItemImpl* CreateSavePageItem(
50 DownloadItemImplDelegate* delegate, 58 DownloadItemImplDelegate* delegate,
51 const FilePath& path, 59 const FilePath& path,
52 const GURL& url, 60 const GURL& url,
53 DownloadId download_id, 61 DownloadId download_id,
54 const std::string& mime_type, 62 const std::string& mime_type,
55 const net::BoundNetLog& bound_net_log) = 0; 63 const net::BoundNetLog& bound_net_log) = 0;
56 }; 64 };
57 65
58 } // namespace content 66 } // namespace content
59 67
60 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_FACTORY_H_ 68 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698