Chromium Code Reviews| Index: content/browser/download/drag_download_file.cc |
| diff --git a/content/browser/download/drag_download_file.cc b/content/browser/download/drag_download_file.cc |
| index c96ad9746779661f300282de1080f8bae9d0e680..6e8bc48fb4e36a859d3a9652cecbd4994c430b4c 100644 |
| --- a/content/browser/download/drag_download_file.cc |
| +++ b/content/browser/download/drag_download_file.cc |
| @@ -105,12 +105,13 @@ class DragDownloadFile::DragDownloadFileUI : public DownloadItem::Observer { |
| virtual void OnDownloadUpdated(DownloadItem* item) OVERRIDE { |
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| DCHECK_EQ(download_item_, item); |
| - if (download_item_->IsComplete() || |
| - download_item_->IsCancelled() || |
| - download_item_->IsInterrupted()) { |
| + DownloadItem::DownloadState state = download_item_->GetState(); |
| + if (state == DownloadItem::COMPLETE || |
| + state == DownloadItem::CANCELLED || |
| + state == DownloadItem::INTERRUPTED) { |
| if (!on_completed_.is_null()) { |
| on_completed_loop_->PostTask(FROM_HERE, base::Bind( |
| - on_completed_, download_item_->IsComplete())); |
| + on_completed_, state == DownloadItem::COMPLETE)); |
| on_completed_.Reset(); |
| } |
| download_item_->RemoveObserver(this); |
| @@ -123,8 +124,10 @@ class DragDownloadFile::DragDownloadFileUI : public DownloadItem::Observer { |
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| DCHECK_EQ(download_item_, item); |
| if (!on_completed_.is_null()) { |
| + const bool isComplete = |
|
benjhayden
2013/06/13 19:01:45
is_complete
|
| + download_item_->GetState() == DownloadItem::COMPLETE; |
| on_completed_loop_->PostTask(FROM_HERE, base::Bind( |
| - on_completed_, download_item_->IsComplete())); |
| + on_completed_, isComplete)); |
| on_completed_.Reset(); |
| } |
| download_item_->RemoveObserver(this); |