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

Unified Diff: chrome/browser/ui/views/download/download_shelf_view.cc

Issue 16018005: Use DownloadItem::GetState() in chrome/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Stopping complete_animation_ when download is cancelled 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: chrome/browser/ui/views/download/download_shelf_view.cc
diff --git a/chrome/browser/ui/views/download/download_shelf_view.cc b/chrome/browser/ui/views/download/download_shelf_view.cc
index e231353c6c06e3d4e795221a7555c051c29e76da..c737a85410f49cfbf31f1f1a9b09e60bc3437161 100644
--- a/chrome/browser/ui/views/download/download_shelf_view.cc
+++ b/chrome/browser/ui/views/download/download_shelf_view.cc
@@ -403,7 +403,7 @@ void DownloadShelfView::DoShow() {
void DownloadShelfView::DoClose(CloseReason reason) {
int num_in_progress = 0;
for (size_t i = 0; i < download_views_.size(); ++i) {
- if (download_views_[i]->download()->IsInProgress())
+ if (download_views_[i]->download()->GetState() == DownloadItem::IN_PROGRESS)
++num_in_progress;
}
download_util::RecordShelfClose(download_views_.size(),
@@ -426,9 +426,10 @@ void DownloadShelfView::Closed() {
size_t i = 0;
while (i < download_views_.size()) {
DownloadItem* download = download_views_[i]->download();
- bool is_transfer_done = download->IsComplete() ||
- download->IsCancelled() ||
- download->IsInterrupted();
+ DownloadItem::DownloadState state = download->GetState();
+ bool is_transfer_done = state == DownloadItem::COMPLETE ||
+ state == DownloadItem::CANCELLED ||
+ state == DownloadItem::INTERRUPTED;
if (is_transfer_done && !download->IsDangerous()) {
RemoveDownloadView(download_views_[i]);
} else {
« no previous file with comments | « chrome/browser/ui/views/download/download_item_view.cc ('k') | chrome/browser/ui/webui/downloads_dom_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698