| Index: chrome/browser/download/download_item.h
|
| diff --git a/chrome/browser/download/download_item.h b/chrome/browser/download/download_item.h
|
| index 7471994d06362483bb21f0343a59254aef42cbbf..ec6ef0dc4ab7f99917862a90edff76b11346019d 100644
|
| --- a/chrome/browser/download/download_item.h
|
| +++ b/chrome/browser/download/download_item.h
|
| @@ -40,8 +40,19 @@ class DownloadItem {
|
| public:
|
| enum DownloadState {
|
| IN_PROGRESS,
|
| +
|
| + // Note that COMPLETE indicates that the download has gotten all of its
|
| + // data, has figured out its final destination file, has been entered
|
| + // into the history store, and has been shown in the UI. The only
|
| + // operations remaining are acceptance by the user of
|
| + // a dangerous download (if dangerous), renaming the file
|
| + // to the final name, and auto-opening it (if it auto-opens).
|
| COMPLETE,
|
| +
|
| CANCELLED,
|
| +
|
| + // This state indicates that the download item is about to be destroyed,
|
| + // and observers seeing this state should release all references.
|
| REMOVING
|
| };
|
|
|
| @@ -128,9 +139,13 @@ class DownloadItem {
|
| // when resuming a download (assuming the server supports byte ranges).
|
| void Cancel(bool update_history);
|
|
|
| - // Called when all data has been saved.
|
| + // Called when all data has been saved. Only has display effects.
|
| void OnAllDataSaved(int64 size);
|
|
|
| + // Called when ready to consider the data received and move on to the
|
| + // next stage.
|
| + void OnDataReceptionAccepted();
|
| +
|
| // Called when the entire download operation (including renaming etc)
|
| // is finished.
|
| void Finished();
|
| @@ -152,6 +167,9 @@ class DownloadItem {
|
| // total size).
|
| int PercentComplete() const;
|
|
|
| + // Whether or not this download has received all of its data.
|
| + bool AllDataReceived() const;
|
| +
|
| // Update the fields that may have changed in DownloadCreateInfo as a
|
| // result of analyzing the file and figuring out its type, location, etc.
|
| // May only be called once.
|
| @@ -335,6 +353,9 @@ class DownloadItem {
|
| // True if the item was downloaded temporarily.
|
| bool is_temporary_;
|
|
|
| + // True if we've received all the data for the download.
|
| + bool all_data_received_;
|
| +
|
| // Did the user open the item either directly or indirectly (such as by
|
| // setting always open files of this type)? The shelf also sets this field
|
| // when the user closes the shelf before the item has been opened but should
|
|
|