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

Unified Diff: chrome/browser/ui/gtk/download/download_shelf_gtk.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/gtk/download/download_shelf_gtk.cc
diff --git a/chrome/browser/ui/gtk/download/download_shelf_gtk.cc b/chrome/browser/ui/gtk/download/download_shelf_gtk.cc
index d709c76d56e3aabda1435b233696fdd99a8ae1f3..7724de78738cc0dc18e6bc76fa7b62bda96791b1 100644
--- a/chrome/browser/ui/gtk/download/download_shelf_gtk.cc
+++ b/chrome/browser/ui/gtk/download/download_shelf_gtk.cc
@@ -206,7 +206,7 @@ void DownloadShelfGtk::DoClose(CloseReason reason) {
browser_->UpdateDownloadShelfVisibility(false);
int num_in_progress = 0;
for (size_t i = 0; i < download_items_.size(); ++i) {
- if (download_items_[i]->download()->IsInProgress())
+ if (download_items_[i]->download()->GetState() == DownloadItem::IN_PROGRESS)
++num_in_progress;
}
download_util::RecordShelfClose(
@@ -227,9 +227,10 @@ void DownloadShelfGtk::Closed() {
size_t i = 0;
while (i < download_items_.size()) {
DownloadItem* download = download_items_[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()) {
RemoveDownloadItem(download_items_[i]);
} else {
« no previous file with comments | « chrome/browser/ui/gtk/download/download_item_gtk.cc ('k') | chrome/browser/ui/views/download/download_item_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698