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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 class BrowserContext; | 53 class BrowserContext; |
54 class ByteStreamReader; | 54 class ByteStreamReader; |
55 class DownloadManagerDelegate; | 55 class DownloadManagerDelegate; |
56 class DownloadQuery; | 56 class DownloadQuery; |
57 class DownloadUrlParameters; | 57 class DownloadUrlParameters; |
58 | 58 |
59 // Browser's download manager: manages all downloads and destination view. | 59 // Browser's download manager: manages all downloads and destination view. |
60 class CONTENT_EXPORT DownloadManager | 60 class CONTENT_EXPORT DownloadManager |
61 : public base::RefCountedThreadSafe<DownloadManager> { | 61 : public base::RefCountedThreadSafe<DownloadManager> { |
62 public: | 62 public: |
63 // A method that can be used in tests to ensure that all the internal download | |
64 // classes have no pending downloads. | |
65 static bool EnsureNoPendingDownloadsForTesting(); | |
66 | |
67 // Sets/Gets the delegate for this DownloadManager. The delegate has to live | 63 // Sets/Gets the delegate for this DownloadManager. The delegate has to live |
68 // past its Shutdown method being called (by the DownloadManager). | 64 // past its Shutdown method being called (by the DownloadManager). |
69 virtual void SetDelegate(DownloadManagerDelegate* delegate) = 0; | 65 virtual void SetDelegate(DownloadManagerDelegate* delegate) = 0; |
70 virtual DownloadManagerDelegate* GetDelegate() const = 0; | 66 virtual DownloadManagerDelegate* GetDelegate() const = 0; |
71 | 67 |
72 // Shutdown the download manager. Content calls this when BrowserContext is | 68 // Shutdown the download manager. Content calls this when BrowserContext is |
73 // being destructed. If the embedder needs this to be called earlier, it can | 69 // being destructed. If the embedder needs this to be called earlier, it can |
74 // call it. In that case, the delegate's Shutdown() method will only be called | 70 // call it. In that case, the delegate's Shutdown() method will only be called |
75 // once. | 71 // once. |
76 virtual void Shutdown() = 0; | 72 virtual void Shutdown() = 0; |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 protected: | 196 protected: |
201 virtual ~DownloadManager() {} | 197 virtual ~DownloadManager() {} |
202 | 198 |
203 private: | 199 private: |
204 friend class base::RefCountedThreadSafe<DownloadManager>; | 200 friend class base::RefCountedThreadSafe<DownloadManager>; |
205 }; | 201 }; |
206 | 202 |
207 } // namespace content | 203 } // namespace content |
208 | 204 |
209 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_ | 205 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_ |
OLD | NEW |