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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 // everything. | 103 // everything. |
104 void SearchDownloads(const string16& query, | 104 void SearchDownloads(const string16& query, |
105 std::vector<DownloadItem*>* result); | 105 std::vector<DownloadItem*>* result); |
106 | 106 |
107 // Returns true if initialized properly. | 107 // Returns true if initialized properly. |
108 bool Init(Profile* profile); | 108 bool Init(Profile* profile); |
109 | 109 |
110 // Notifications sent from the download thread to the UI thread | 110 // Notifications sent from the download thread to the UI thread |
111 void StartDownload(DownloadCreateInfo* info); | 111 void StartDownload(DownloadCreateInfo* info); |
112 void UpdateDownload(int32 download_id, int64 size); | 112 void UpdateDownload(int32 download_id, int64 size); |
| 113 void OnResponseCompleted(int32 download_id, int64 size, int os_error); |
113 void OnAllDataSaved(int32 download_id, int64 size); | 114 void OnAllDataSaved(int32 download_id, int64 size); |
| 115 void DownloadError(int32 download_id, int64 size, int os_error); |
114 | 116 |
115 // Called from a view when a user clicks a UI button or link. | 117 // Called from a view when a user clicks a UI button or link. |
116 void DownloadCancelled(int32 download_id); | 118 void DownloadCancelled(int32 download_id); |
117 void PauseDownload(int32 download_id, bool pause); | 119 void PauseDownload(int32 download_id, bool pause); |
| 120 void RestartDownload(int32 download_id); |
118 void RemoveDownload(int64 download_handle); | 121 void RemoveDownload(int64 download_handle); |
119 | 122 |
120 // Called when the download is renamed to its final name. | 123 // Called when the download is renamed to its final name. |
121 void DownloadRenamedToFinalName(int download_id, const FilePath& full_path); | 124 void DownloadRenamedToFinalName(int download_id, const FilePath& full_path); |
122 | 125 |
123 // Remove downloads after remove_begin (inclusive) and before remove_end | 126 // Remove downloads after remove_begin (inclusive) and before remove_end |
124 // (exclusive). You may pass in null Time values to do an unbounded delete | 127 // (exclusive). You may pass in null Time values to do an unbounded delete |
125 // in either direction. | 128 // in either direction. |
126 int RemoveDownloadsBetween(const base::Time remove_begin, | 129 int RemoveDownloadsBetween(const base::Time remove_begin, |
127 const base::Time remove_end); | 130 const base::Time remove_end); |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 // the change to the history system. | 272 // the change to the history system. |
270 void RenameDownload(DownloadItem* download, const FilePath& new_path); | 273 void RenameDownload(DownloadItem* download, const FilePath& new_path); |
271 | 274 |
272 // Makes the ResourceDispatcherHost pause/un-pause a download request. | 275 // Makes the ResourceDispatcherHost pause/un-pause a download request. |
273 // Called on the IO thread. | 276 // Called on the IO thread. |
274 void PauseDownloadRequest(ResourceDispatcherHost* rdh, | 277 void PauseDownloadRequest(ResourceDispatcherHost* rdh, |
275 int render_process_id, | 278 int render_process_id, |
276 int request_id, | 279 int request_id, |
277 bool pause); | 280 bool pause); |
278 | 281 |
| 282 // Makes the ResourceDispatcherHost restart a download request. |
| 283 // Called on the IO thread. |
| 284 void RestartDownloadRequest(ResourceDispatcherHost* rdh, |
| 285 int render_process_id, |
| 286 int request_id, |
| 287 DownloadCreateInfo* info); |
| 288 |
279 // Inform observers that the model has changed. | 289 // Inform observers that the model has changed. |
280 void NotifyModelChanged(); | 290 void NotifyModelChanged(); |
281 | 291 |
282 DownloadItem* GetDownloadItem(int id); | 292 DownloadItem* GetDownloadItem(int id); |
283 | 293 |
284 // 'downloads_' is map of all downloads in this profile. The key is the handle | 294 // 'downloads_' is map of all downloads in this profile. The key is the handle |
285 // returned by the history system, which is unique across sessions. This map | 295 // returned by the history system, which is unique across sessions. This map |
286 // owns all the DownloadItems once they have been created in the history | 296 // owns all the DownloadItems once they have been created in the history |
287 // system. | 297 // system. |
288 // | 298 // |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 // The "Save As" dialog box used to ask the user where a file should be | 356 // The "Save As" dialog box used to ask the user where a file should be |
347 // saved. | 357 // saved. |
348 scoped_refptr<SelectFileDialog> select_file_dialog_; | 358 scoped_refptr<SelectFileDialog> select_file_dialog_; |
349 | 359 |
350 scoped_ptr<OtherDownloadManagerObserver> other_download_manager_observer_; | 360 scoped_ptr<OtherDownloadManagerObserver> other_download_manager_observer_; |
351 | 361 |
352 DISALLOW_COPY_AND_ASSIGN(DownloadManager); | 362 DISALLOW_COPY_AND_ASSIGN(DownloadManager); |
353 }; | 363 }; |
354 | 364 |
355 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_H_ | 365 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_H_ |
OLD | NEW |