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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 protected: | 101 protected: |
102 virtual ~Observer() {} | 102 virtual ~Observer() {} |
103 }; | 103 }; |
104 | 104 |
105 typedef std::vector<DownloadItem*> DownloadVector; | 105 typedef std::vector<DownloadItem*> DownloadVector; |
106 | 106 |
107 // Add all download items to |downloads|, no matter the type or state, without | 107 // Add all download items to |downloads|, no matter the type or state, without |
108 // clearing |downloads| first. | 108 // clearing |downloads| first. |
109 virtual void GetAllDownloads(DownloadVector* downloads) = 0; | 109 virtual void GetAllDownloads(DownloadVector* downloads) = 0; |
110 | 110 |
111 // Returns all non-temporary downloads matching |query|. Empty query matches | |
112 // everything. | |
113 virtual void SearchDownloads(const string16& query, | |
114 DownloadVector* result) = 0; | |
115 | |
116 // Returns true if initialized properly. | 111 // Returns true if initialized properly. |
117 virtual bool Init(BrowserContext* browser_context) = 0; | 112 virtual bool Init(BrowserContext* browser_context) = 0; |
118 | 113 |
119 // Called by a download source (Currently DownloadResourceHandler) | 114 // Called by a download source (Currently DownloadResourceHandler) |
120 // to initiate the non-source portions of a download. | 115 // to initiate the non-source portions of a download. |
121 // Returns the id assigned to the download. If the DownloadCreateInfo | 116 // Returns the id assigned to the download. If the DownloadCreateInfo |
122 // specifies an id, that id will be used. | 117 // specifies an id, that id will be used. |
123 virtual DownloadId StartDownload( | 118 virtual DownloadId StartDownload( |
124 scoped_ptr<DownloadCreateInfo> info, | 119 scoped_ptr<DownloadCreateInfo> info, |
125 scoped_ptr<ByteStreamReader> stream) = 0; | 120 scoped_ptr<ByteStreamReader> stream) = 0; |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 protected: | 208 protected: |
214 virtual ~DownloadManager() {} | 209 virtual ~DownloadManager() {} |
215 | 210 |
216 private: | 211 private: |
217 friend class base::RefCountedThreadSafe<DownloadManager>; | 212 friend class base::RefCountedThreadSafe<DownloadManager>; |
218 }; | 213 }; |
219 | 214 |
220 } // namespace content | 215 } // namespace content |
221 | 216 |
222 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_ | 217 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_ |
OLD | NEW |