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

Unified Diff: content/browser/download/drag_download_file.cc

Issue 16994004: Remove DownloadItem::Is*() in favor of DI::GetState() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@di-getstate-2
Patch Set: Created 7 years, 6 months 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 side-by-side diff with in-line comments
Download patch
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);

Powered by Google App Engine
This is Rietveld 408576698