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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 virtual void DownloadUrl(scoped_ptr<DownloadUrlParameters> parameters) = 0; | 178 virtual void DownloadUrl(scoped_ptr<DownloadUrlParameters> parameters) = 0; |
179 | 179 |
180 // Allow objects to observe the download creation process. | 180 // Allow objects to observe the download creation process. |
181 virtual void AddObserver(Observer* observer) = 0; | 181 virtual void AddObserver(Observer* observer) = 0; |
182 | 182 |
183 // Remove a download observer from ourself. | 183 // Remove a download observer from ourself. |
184 virtual void RemoveObserver(Observer* observer) = 0; | 184 virtual void RemoveObserver(Observer* observer) = 0; |
185 | 185 |
186 // Called by the embedder, after creating the download manager, to let it know | 186 // Called by the embedder, after creating the download manager, to let it know |
187 // about downloads from previous runs of the browser. | 187 // about downloads from previous runs of the browser. |
188 virtual void OnPersistentStoreQueryComplete( | 188 virtual DownloadItem* CreateDownloadItem( |
189 std::vector<DownloadPersistentStoreInfo>* entries) = 0; | 189 const FilePath& path, |
190 | 190 const GURL& url, |
191 // Called by the embedder, in response to | 191 const GURL& referrer_url, |
192 // DownloadManagerDelegate::AddItemToPersistentStore. | 192 const base::Time& start_time, |
193 virtual void OnItemAddedToPersistentStore(int32 download_id, | 193 const base::Time& end_time, |
194 int64 db_handle) = 0; | 194 int64 received_bytes, |
| 195 int64 total_bytes, |
| 196 DownloadItem::DownloadState state, |
| 197 bool opened) = 0; |
195 | 198 |
196 // The number of in progress (including paused) downloads. | 199 // The number of in progress (including paused) downloads. |
197 virtual int InProgressCount() const = 0; | 200 virtual int InProgressCount() const = 0; |
198 | 201 |
199 virtual BrowserContext* GetBrowserContext() const = 0; | 202 virtual BrowserContext* GetBrowserContext() const = 0; |
200 | 203 |
201 // Checks whether downloaded files still exist. Updates state of downloads | 204 // Checks whether downloaded files still exist. Updates state of downloads |
202 // that refer to removed files. The check runs in the background and may | 205 // that refer to removed files. The check runs in the background and may |
203 // finish asynchronously after this method returns. | 206 // finish asynchronously after this method returns. |
204 virtual void CheckForHistoryFilesRemoval() = 0; | 207 virtual void CheckForHistoryFilesRemoval() = 0; |
(...skipping 18 matching lines...) Expand all Loading... |
223 protected: | 226 protected: |
224 virtual ~DownloadManager() {} | 227 virtual ~DownloadManager() {} |
225 | 228 |
226 private: | 229 private: |
227 friend class base::RefCountedThreadSafe<DownloadManager>; | 230 friend class base::RefCountedThreadSafe<DownloadManager>; |
228 }; | 231 }; |
229 | 232 |
230 } // namespace content | 233 } // namespace content |
231 | 234 |
232 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_ | 235 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_ |
OLD | NEW |