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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
72 // Shutdown the download manager. Content calls this when BrowserContext is | 72 // Shutdown the download manager. Content calls this when BrowserContext is |
73 // being destructed. If the embedder needs this to be called earlier, it can | 73 // 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 | 74 // call it. In that case, the delegate's Shutdown() method will only be called |
75 // once. | 75 // once. |
76 virtual void Shutdown() = 0; | 76 virtual void Shutdown() = 0; |
77 | 77 |
78 // Interface to implement for observers that wish to be informed of changes | 78 // Interface to implement for observers that wish to be informed of changes |
79 // to the DownloadManager's collection of downloads. | 79 // to the DownloadManager's collection of downloads. |
80 class CONTENT_EXPORT Observer { | 80 class CONTENT_EXPORT Observer { |
81 public: | 81 public: |
82 // A DownloadItem was created. No guarantees are made about its state: it | |
83 // may have just been loaded from history, it may be an active download, or | |
84 // it may be a SavePage download, it may or may not already be persisted. | |
Randy Smith (Not in Mondays)
2012/07/14 19:39:13
I'd feel better about this if we could make guaran
benjhayden
2012/07/18 21:28:31
Updated the comment to clarify which features are
| |
85 virtual void OnDownloadCreated( | |
86 DownloadManager* manager, DownloadItem* item) {} | |
Randy Smith (Not in Mondays)
2012/07/14 19:39:13
What are your thoughts about a paired OnDownloadRe
benjhayden
2012/07/18 21:28:31
http://codereview.chromium.org/10704026/
Hanging a
| |
87 | |
82 // New or deleted download, observers should query us for the current set | 88 // New or deleted download, observers should query us for the current set |
83 // of downloads. | 89 // of downloads. |
84 virtual void ModelChanged(DownloadManager* manager) = 0; | 90 virtual void ModelChanged(DownloadManager* manager) {} |
85 | 91 |
86 // Called when the DownloadManager is being destroyed to prevent Observers | 92 // Called when the DownloadManager is being destroyed to prevent Observers |
87 // from calling back to a stale pointer. | 93 // from calling back to a stale pointer. |
88 virtual void ManagerGoingDown(DownloadManager* manager) {} | 94 virtual void ManagerGoingDown(DownloadManager* manager) {} |
89 | 95 |
90 // Called immediately after the DownloadManager puts up a select file | 96 // Called immediately after the DownloadManager puts up a select file |
91 // dialog. | 97 // dialog. |
92 // |id| indicates which download opened the dialog. | 98 // |id| indicates which download opened the dialog. |
93 virtual void SelectFileDialogDisplayed( | 99 virtual void SelectFileDialogDisplayed( |
94 DownloadManager* manager, int32 id) {} | 100 DownloadManager* manager, int32 id) {} |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
247 protected: | 253 protected: |
248 virtual ~DownloadManager() {} | 254 virtual ~DownloadManager() {} |
249 | 255 |
250 private: | 256 private: |
251 friend class base::RefCountedThreadSafe<DownloadManager>; | 257 friend class base::RefCountedThreadSafe<DownloadManager>; |
252 }; | 258 }; |
253 | 259 |
254 } // namespace content | 260 } // namespace content |
255 | 261 |
256 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_ | 262 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_ |
OLD | NEW |