Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(678)

Side by Side Diff: content/browser/download/download_item.h

Issue 8414007: Rearrange Should*Download delegate calls to be more useful and intuitive. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged to TOT. Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 // Each download is represented by a DownloadItem, and all DownloadItems 5 // Each download is represented by a DownloadItem, and all DownloadItems
6 // are owned by the DownloadManager which maintains a global list of all 6 // are owned by the DownloadManager which maintains a global list of all
7 // downloads. DownloadItems are created when a user initiates a download, 7 // downloads. DownloadItems are created when a user initiates a download,
8 // and exist for the duration of the browser life time. 8 // and exist for the duration of the browser life time.
9 // 9 //
10 // Download observers: 10 // Download observers:
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 // exit to prevent this crash. This may result in a difference between the 169 // exit to prevent this crash. This may result in a difference between the
170 // downloaded file's size on disk, and what the history system's last record 170 // downloaded file's size on disk, and what the history system's last record
171 // of it is. At worst, we'll end up re-downloading a small portion of the file 171 // of it is. At worst, we'll end up re-downloading a small portion of the file
172 // when resuming a download (assuming the server supports byte ranges). 172 // when resuming a download (assuming the server supports byte ranges).
173 void Cancel(bool user_cancel); 173 void Cancel(bool user_cancel);
174 174
175 // Called by external code (SavePackage) using the DownloadItem interface 175 // Called by external code (SavePackage) using the DownloadItem interface
176 // to display progress when the DownloadItem should be considered complete. 176 // to display progress when the DownloadItem should be considered complete.
177 void MarkAsComplete(); 177 void MarkAsComplete();
178 178
179 // Called by the delegate after it delayed completing the download in 179 // Called by the delegate after it delayed opening the download in
180 // DownloadManagerDelegate::ShouldCompleteDownload. 180 // DownloadManagerDelegate::ShouldOpenDownload.
181 void CompleteDelayedDownload(); 181 void DelayedDownloadOpened();
182 182
183 // Called when all data has been saved. Only has display effects. 183 // Called when all data has been saved. Only has display effects.
184 void OnAllDataSaved(int64 size); 184 void OnAllDataSaved(int64 size);
185 185
186 // Called when the downloaded file is removed. 186 // Called when the downloaded file is removed.
187 void OnDownloadedFileRemoved(); 187 void OnDownloadedFileRemoved();
188 188
189 // Download operation had an error. 189 // Download operation had an error.
190 // |size| is the amount of data received at interruption. 190 // |size| is the amount of data received at interruption.
191 // |reason| is the download interrupt reason code that the operation received. 191 // |reason| is the download interrupt reason code that the operation received.
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 // only. 485 // only.
486 bool open_enabled_; 486 bool open_enabled_;
487 487
488 // Did the delegate delay calling Complete on this download? 488 // Did the delegate delay calling Complete on this download?
489 bool delegate_delayed_complete_; 489 bool delegate_delayed_complete_;
490 490
491 DISALLOW_COPY_AND_ASSIGN(DownloadItem); 491 DISALLOW_COPY_AND_ASSIGN(DownloadItem);
492 }; 492 };
493 493
494 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_H_ 494 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_H_
OLDNEW
« no previous file with comments | « chrome/browser/download/chrome_download_manager_delegate.cc ('k') | content/browser/download/download_item.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698