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< | 62 : public base::RefCountedThreadSafe< |
61 DownloadManager, content::BrowserThread::DeleteOnUIThread> { | 63 DownloadManager, content::BrowserThread::DeleteOnUIThread> { |
62 public: | 64 public: |
63 virtual ~DownloadManager() {} | 65 virtual ~DownloadManager() {} |
64 | 66 |
| 67 static DownloadManager* Create( |
| 68 DownloadManagerDelegate* delegate, |
| 69 DownloadIdFactory* id_factory, |
| 70 DownloadStatusUpdater* status_updater); |
| 71 |
65 // Shutdown the download manager. Must be called before destruction. | 72 // Shutdown the download manager. Must be called before destruction. |
66 virtual void Shutdown() = 0; | 73 virtual void Shutdown() = 0; |
67 | 74 |
68 // Interface to implement for observers that wish to be informed of changes | 75 // Interface to implement for observers that wish to be informed of changes |
69 // to the DownloadManager's collection of downloads. | 76 // to the DownloadManager's collection of downloads. |
70 class CONTENT_EXPORT Observer { | 77 class CONTENT_EXPORT Observer { |
71 public: | 78 public: |
72 // New or deleted download, observers should query us for the current set | 79 // New or deleted download, observers should query us for the current set |
73 // of downloads. | 80 // of downloads. |
74 virtual void ModelChanged() = 0; | 81 virtual void ModelChanged() = 0; |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 friend class base::RefCountedThreadSafe< | 271 friend class base::RefCountedThreadSafe< |
265 DownloadManager, content::BrowserThread::DeleteOnUIThread>; | 272 DownloadManager, content::BrowserThread::DeleteOnUIThread>; |
266 friend struct content::BrowserThread::DeleteOnThread< | 273 friend struct content::BrowserThread::DeleteOnThread< |
267 content::BrowserThread::UI>; | 274 content::BrowserThread::UI>; |
268 friend class base::DeleteHelper<DownloadManager>; | 275 friend class base::DeleteHelper<DownloadManager>; |
269 }; | 276 }; |
270 | 277 |
271 } // namespace content | 278 } // namespace content |
272 | 279 |
273 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_ | 280 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_ |
OLD | NEW |