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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 | 122 |
123 // Called from a view when a user clicks a UI button or link. | 123 // Called from a view when a user clicks a UI button or link. |
124 void DownloadCancelled(int32 download_id); | 124 void DownloadCancelled(int32 download_id); |
125 void PauseDownload(int32 download_id, bool pause); | 125 void PauseDownload(int32 download_id, bool pause); |
126 void RemoveDownload(int64 download_handle); | 126 void RemoveDownload(int64 download_handle); |
127 | 127 |
| 128 // Determine if the download is ready for completion, i.e. has had |
| 129 // all data received, and completed the filename determination and |
| 130 // history insertion. |
| 131 bool IsDownloadReadyForCompletion(int32 download_id); |
| 132 |
| 133 // If all pre-requisites have been met, complete download processing, i.e. |
| 134 // do internal cleanup, file rename, and potentially auto-open. |
| 135 // (Dangerous downloads still may block on user acceptance after this |
| 136 // point.) |
| 137 void MaybeCompleteDownload(int32 download_id); |
| 138 |
128 // Called when the download is renamed to its final name. | 139 // Called when the download is renamed to its final name. |
129 void DownloadRenamedToFinalName(int download_id, const FilePath& full_path); | 140 void DownloadRenamedToFinalName(int download_id, const FilePath& full_path); |
130 | 141 |
131 // Remove downloads after remove_begin (inclusive) and before remove_end | 142 // Remove downloads after remove_begin (inclusive) and before remove_end |
132 // (exclusive). You may pass in null Time values to do an unbounded delete | 143 // (exclusive). You may pass in null Time values to do an unbounded delete |
133 // in either direction. | 144 // in either direction. |
134 int RemoveDownloadsBetween(const base::Time remove_begin, | 145 int RemoveDownloadsBetween(const base::Time remove_begin, |
135 const base::Time remove_end); | 146 const base::Time remove_end); |
136 | 147 |
137 // Remove downloads will delete all downloads that have a timestamp that is | 148 // Remove downloads will delete all downloads that have a timestamp that is |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 // The "Save As" dialog box used to ask the user where a file should be | 391 // The "Save As" dialog box used to ask the user where a file should be |
381 // saved. | 392 // saved. |
382 scoped_refptr<SelectFileDialog> select_file_dialog_; | 393 scoped_refptr<SelectFileDialog> select_file_dialog_; |
383 | 394 |
384 scoped_ptr<OtherDownloadManagerObserver> other_download_manager_observer_; | 395 scoped_ptr<OtherDownloadManagerObserver> other_download_manager_observer_; |
385 | 396 |
386 DISALLOW_COPY_AND_ASSIGN(DownloadManager); | 397 DISALLOW_COPY_AND_ASSIGN(DownloadManager); |
387 }; | 398 }; |
388 | 399 |
389 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_H_ | 400 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_H_ |
OLD | NEW |