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

Side by Side Diff: content/public/browser/download_manager.h

Issue 10535026: Move creation and ownership of DownloadManager from the embedder to content. This matches all the o… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 6 months 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 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
53 53
54 class BrowserContext; 54 class BrowserContext;
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 static DownloadManager* Create(
64 DownloadManagerDelegate* delegate,
65 net::NetLog* net_log);
66
67 // A method that can be used in tests to ensure that all the internal download 63 // A method that can be used in tests to ensure that all the internal download
68 // classes have no pending downloads. 64 // classes have no pending downloads.
69 static bool EnsureNoPendingDownloadsForTesting(); 65 static bool EnsureNoPendingDownloadsForTesting();
70 66
67 virtual void SetDelegate(DownloadManagerDelegate* delegate) = 0;
68
71 // Shutdown the download manager. Must be called before destruction. 69 // Shutdown the download manager. Must be called before destruction.
72 virtual void Shutdown() = 0; 70 virtual void Shutdown() = 0;
73 71
74 // Interface to implement for observers that wish to be informed of changes 72 // Interface to implement for observers that wish to be informed of changes
75 // to the DownloadManager's collection of downloads. 73 // to the DownloadManager's collection of downloads.
76 class CONTENT_EXPORT Observer { 74 class CONTENT_EXPORT Observer {
77 public: 75 public:
78 // New or deleted download, observers should query us for the current set 76 // New or deleted download, observers should query us for the current set
79 // of downloads. 77 // of downloads.
80 virtual void ModelChanged(DownloadManager* manager) = 0; 78 virtual void ModelChanged(DownloadManager* manager) = 0;
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 protected: 239 protected:
242 virtual ~DownloadManager() {} 240 virtual ~DownloadManager() {}
243 241
244 private: 242 private:
245 friend class base::RefCountedThreadSafe<DownloadManager>; 243 friend class base::RefCountedThreadSafe<DownloadManager>;
246 }; 244 };
247 245
248 } // namespace content 246 } // namespace content
249 247
250 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_ 248 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698