Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 profile in Chrome. | 8 // active profile in Chrome. |
| 9 // | 9 // |
| 10 // Download observers: | 10 // Download observers: |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 112 void SearchDownloads(const string16& query, | 112 void SearchDownloads(const string16& query, |
| 113 std::vector<DownloadItem*>* result); | 113 std::vector<DownloadItem*>* result); |
| 114 | 114 |
| 115 // Returns true if initialized properly. | 115 // Returns true if initialized properly. |
| 116 bool Init(Profile* profile); | 116 bool Init(Profile* profile); |
| 117 | 117 |
| 118 // Notifications sent from the download thread to the UI thread | 118 // Notifications sent from the download thread to the UI thread |
| 119 void StartDownload(DownloadCreateInfo* info); | 119 void StartDownload(DownloadCreateInfo* info); |
| 120 void UpdateDownload(int32 download_id, int64 size); | 120 void UpdateDownload(int32 download_id, int64 size); |
| 121 void OnAllDataSaved(int32 download_id, int64 size); | 121 void OnAllDataSaved(int32 download_id, int64 size); |
| 122 void OnDownloadFileCompleted(int32 download_id); | |
| 122 | 123 |
| 123 // Called from a view when a user clicks a UI button or link. | 124 // Called from a view when a user clicks a UI button or link. |
| 124 void DownloadCancelled(int32 download_id); | 125 void DownloadCancelled(int32 download_id); |
| 125 void PauseDownload(int32 download_id, bool pause); | 126 void PauseDownload(int32 download_id, bool pause); |
| 126 void RemoveDownload(int64 download_handle); | 127 void RemoveDownload(int64 download_handle); |
| 127 | 128 |
| 128 // Called when the download is renamed to its final name. | 129 // Called when the download is renamed to its final name. |
| 129 void DownloadRenamedToFinalName(int download_id, const FilePath& full_path); | 130 void DownloadRenamedToFinalName(int download_id, const FilePath& full_path); |
| 130 | 131 |
| 131 // Remove downloads after remove_begin (inclusive) and before remove_end | 132 // Remove downloads after remove_begin (inclusive) and before remove_end |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 325 // map. When the download is complete, it is removed from | 326 // map. When the download is complete, it is removed from |
| 326 // |in_progress_|. Downloads from past sessions read from a | 327 // |in_progress_|. Downloads from past sessions read from a |
| 327 // persisted state from the history system are placed directly into | 328 // persisted state from the history system are placed directly into |
| 328 // |history_downloads_| since they have valid handles in the history system. | 329 // |history_downloads_| since they have valid handles in the history system. |
| 329 typedef std::set<DownloadItem*> DownloadSet; | 330 typedef std::set<DownloadItem*> DownloadSet; |
| 330 typedef base::hash_map<int64, DownloadItem*> DownloadMap; | 331 typedef base::hash_map<int64, DownloadItem*> DownloadMap; |
| 331 | 332 |
| 332 DownloadSet downloads_; | 333 DownloadSet downloads_; |
| 333 DownloadMap history_downloads_; | 334 DownloadMap history_downloads_; |
| 334 DownloadMap in_progress_; | 335 DownloadMap in_progress_; |
| 336 DownloadMap active_downloads_; | |
|
Randy Smith (Not in Mondays)
2011/01/03 22:02:22
Add a comment above parallel to the ones already t
ahendrickson
2011/01/04 16:51:38
Done.
| |
| 335 #if !defined(NDEBUG) | 337 #if !defined(NDEBUG) |
| 336 DownloadSet save_page_as_downloads_; | 338 DownloadSet save_page_as_downloads_; |
| 337 #endif | 339 #endif |
| 338 | 340 |
| 339 // True if the download manager has been initialized and requires a shutdown. | 341 // True if the download manager has been initialized and requires a shutdown. |
| 340 bool shutdown_needed_; | 342 bool shutdown_needed_; |
| 341 | 343 |
| 342 // Observers that want to be notified of changes to the set of downloads. | 344 // Observers that want to be notified of changes to the set of downloads. |
| 343 ObserverList<Observer> observers_; | 345 ObserverList<Observer> observers_; |
| 344 | 346 |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 371 // The "Save As" dialog box used to ask the user where a file should be | 373 // The "Save As" dialog box used to ask the user where a file should be |
| 372 // saved. | 374 // saved. |
| 373 scoped_refptr<SelectFileDialog> select_file_dialog_; | 375 scoped_refptr<SelectFileDialog> select_file_dialog_; |
| 374 | 376 |
| 375 scoped_ptr<OtherDownloadManagerObserver> other_download_manager_observer_; | 377 scoped_ptr<OtherDownloadManagerObserver> other_download_manager_observer_; |
| 376 | 378 |
| 377 DISALLOW_COPY_AND_ASSIGN(DownloadManager); | 379 DISALLOW_COPY_AND_ASSIGN(DownloadManager); |
| 378 }; | 380 }; |
| 379 | 381 |
| 380 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_H_ | 382 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_H_ |
| OLD | NEW |