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 DownloadManager object manages the process of downloading, including | 5 // The DownloadManager object manages the process of downloading, including |
6 // updates to the history system and providing the information for displaying | 6 // updates to the history system and providing the information for displaying |
7 // the downloads view in the Destinations tab. There is one DownloadManager per | 7 // the downloads view in the Destinations tab. There is one DownloadManager per |
8 // active browser context in Chrome. | 8 // active browser context in Chrome. |
9 // | 9 // |
10 // Download observers: | 10 // Download observers: |
(...skipping 25 matching lines...) Expand all Loading... |
36 #include "base/gtest_prod_util.h" | 36 #include "base/gtest_prod_util.h" |
37 #include "base/message_loop_helpers.h" | 37 #include "base/message_loop_helpers.h" |
38 #include "base/time.h" | 38 #include "base/time.h" |
39 #include "content/browser/download/download_id.h" | 39 #include "content/browser/download/download_id.h" |
40 #include "content/browser/download/interrupt_reasons.h" | 40 #include "content/browser/download/interrupt_reasons.h" |
41 #include "content/public/browser/download_item.h" | 41 #include "content/public/browser/download_item.h" |
42 #include "content/public/browser/browser_thread.h" | 42 #include "content/public/browser/browser_thread.h" |
43 #include "net/base/net_errors.h" | 43 #include "net/base/net_errors.h" |
44 | 44 |
45 class DownloadFileManager; | 45 class DownloadFileManager; |
| 46 class DownloadIdFactory; |
46 class DownloadManagerTest; | 47 class DownloadManagerTest; |
47 class DownloadRequestHandle; | 48 class DownloadRequestHandle; |
| 49 class DownloadStatusUpdater; |
48 class GURL; | 50 class GURL; |
49 class TabContents; | 51 class TabContents; |
50 struct DownloadCreateInfo; | 52 struct DownloadCreateInfo; |
51 struct DownloadSaveInfo; | 53 struct DownloadSaveInfo; |
52 | 54 |
53 namespace content { | 55 namespace content { |
54 class BrowserContext; | 56 class BrowserContext; |
55 class DownloadManagerDelegate; | 57 class DownloadManagerDelegate; |
56 class WebContents; | 58 class WebContents; |
57 | 59 |
58 // Browser's download manager: manages all downloads and destination view. | 60 // Browser's download manager: manages all downloads and destination view. |
59 class CONTENT_EXPORT DownloadManager | 61 class CONTENT_EXPORT DownloadManager |
60 : public base::RefCountedThreadSafe<DownloadManager> { | 62 : public base::RefCountedThreadSafe<DownloadManager> { |
61 public: | 63 public: |
62 virtual ~DownloadManager() {} | 64 virtual ~DownloadManager() {} |
63 | 65 |
| 66 static DownloadManager* Create( |
| 67 DownloadManagerDelegate* delegate, |
| 68 DownloadIdFactory* id_factory, |
| 69 DownloadStatusUpdater* status_updater); |
| 70 |
64 // Shutdown the download manager. Must be called before destruction. | 71 // Shutdown the download manager. Must be called before destruction. |
65 virtual void Shutdown() = 0; | 72 virtual void Shutdown() = 0; |
66 | 73 |
67 // Interface to implement for observers that wish to be informed of changes | 74 // Interface to implement for observers that wish to be informed of changes |
68 // to the DownloadManager's collection of downloads. | 75 // to the DownloadManager's collection of downloads. |
69 class CONTENT_EXPORT Observer { | 76 class CONTENT_EXPORT Observer { |
70 public: | 77 public: |
71 // New or deleted download, observers should query us for the current set | 78 // New or deleted download, observers should query us for the current set |
72 // of downloads. | 79 // of downloads. |
73 virtual void ModelChanged() = 0; | 80 virtual void ModelChanged() = 0; |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 friend class base::RefCountedThreadSafe< | 273 friend class base::RefCountedThreadSafe< |
267 DownloadManager, content::BrowserThread::DeleteOnUIThread>; | 274 DownloadManager, content::BrowserThread::DeleteOnUIThread>; |
268 friend struct content::BrowserThread::DeleteOnThread< | 275 friend struct content::BrowserThread::DeleteOnThread< |
269 content::BrowserThread::UI>; | 276 content::BrowserThread::UI>; |
270 friend class base::DeleteHelper<DownloadManager>; | 277 friend class base::DeleteHelper<DownloadManager>; |
271 }; | 278 }; |
272 | 279 |
273 } // namespace content | 280 } // namespace content |
274 | 281 |
275 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_ | 282 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_ |
OLD | NEW |