OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 | 267 |
268 DownloadManagerDelegate* delegate() const { return delegate_; } | 268 DownloadManagerDelegate* delegate() const { return delegate_; } |
269 | 269 |
270 private: | 270 private: |
271 typedef std::set<DownloadItem*> DownloadSet; | 271 typedef std::set<DownloadItem*> DownloadSet; |
272 typedef base::hash_map<int64, DownloadItem*> DownloadMap; | 272 typedef base::hash_map<int64, DownloadItem*> DownloadMap; |
273 | 273 |
274 // For testing. | 274 // For testing. |
275 friend class DownloadManagerTest; | 275 friend class DownloadManagerTest; |
276 friend class MockDownloadManager; | 276 friend class MockDownloadManager; |
| 277 friend class DownloadTest; |
277 | 278 |
278 friend struct BrowserThread::DeleteOnThread<BrowserThread::UI>; | 279 friend struct BrowserThread::DeleteOnThread<BrowserThread::UI>; |
279 friend class DeleteTask<DownloadManager>; | 280 friend class DeleteTask<DownloadManager>; |
280 | 281 |
| 282 void set_delegate(DownloadManagerDelegate* delegate) { delegate_ = delegate; } |
| 283 |
281 virtual ~DownloadManager(); | 284 virtual ~DownloadManager(); |
282 | 285 |
283 // Called on the FILE thread to check the existence of a downloaded file. | 286 // Called on the FILE thread to check the existence of a downloaded file. |
284 void CheckForFileRemovalOnFileThread(int64 db_handle, const FilePath& path); | 287 void CheckForFileRemovalOnFileThread(int64 db_handle, const FilePath& path); |
285 | 288 |
286 // Called on the UI thread if the FILE thread detects the removal of | 289 // Called on the UI thread if the FILE thread detects the removal of |
287 // the downloaded file. The UI thread updates the state of the file | 290 // the downloaded file. The UI thread updates the state of the file |
288 // and then notifies this update to the file's observer. | 291 // and then notifies this update to the file's observer. |
289 void OnFileRemovalDetected(int64 db_handle); | 292 void OnFileRemovalDetected(int64 db_handle); |
290 | 293 |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 DownloadManagerDelegate* delegate_; | 400 DownloadManagerDelegate* delegate_; |
398 | 401 |
399 // TODO(rdsmith): Remove when http://crbug.com/84508 is fixed. | 402 // TODO(rdsmith): Remove when http://crbug.com/84508 is fixed. |
400 // For debugging only. | 403 // For debugging only. |
401 int64 largest_db_handle_in_history_; | 404 int64 largest_db_handle_in_history_; |
402 | 405 |
403 DISALLOW_COPY_AND_ASSIGN(DownloadManager); | 406 DISALLOW_COPY_AND_ASSIGN(DownloadManager); |
404 }; | 407 }; |
405 | 408 |
406 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_H_ | 409 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_H_ |
OLD | NEW |