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

Unified Diff: chrome/browser/ui/gtk/download/download_item_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
« no previous file with comments | « chrome/browser/ui/gtk/custom_drag.cc ('k') | chrome/browser/ui/gtk/download/download_shelf_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/gtk/download/download_item_gtk.cc
diff --git a/chrome/browser/ui/gtk/download/download_item_gtk.cc b/chrome/browser/ui/gtk/download/download_item_gtk.cc
index 7ac7c2ae9332a88c8ddf3f57afa32e2c90e814a2..7577367abb2d9ce29658e30cfbf4f4ac0372d35b 100644
--- a/chrome/browser/ui/gtk/download/download_item_gtk.cc
+++ b/chrome/browser/ui/gtk/download/download_item_gtk.cc
@@ -456,10 +456,10 @@ void DownloadItemGtk::OnLoadSmallIconComplete(gfx::Image* image) {
void DownloadItemGtk::OnLoadLargeIconComplete(gfx::Image* image) {
icon_large_ = image;
- if (download()->IsComplete())
+ if (download()->GetState() == DownloadItem::COMPLETE)
DownloadItemDrag::SetSource(body_.get(), download(), icon_large_);
// Else, the download will be made draggable once an OnDownloadUpdated()
- // notification is received with download->IsComplete().
+ // notification is received with a download in COMPLETE state.
}
void DownloadItemGtk::LoadIcon() {
@@ -849,8 +849,9 @@ gboolean DownloadItemGtk::OnProgressAreaExpose(GtkWidget* widget,
// Create a transparent canvas.
gfx::CanvasSkiaPaint canvas(event, false);
+ DownloadItem::DownloadState state = download()->GetState();
if (complete_animation_.is_animating()) {
- if (download()->IsInterrupted()) {
+ if (state == DownloadItem::INTERRUPTED) {
download_util::PaintDownloadInterrupted(&canvas,
allocation.x, allocation.y,
complete_animation_.GetCurrentValue(),
@@ -861,7 +862,7 @@ gboolean DownloadItemGtk::OnProgressAreaExpose(GtkWidget* widget,
complete_animation_.GetCurrentValue(),
download_util::SMALL);
}
- } else if (download()->IsInProgress()) {
+ } else if (state == DownloadItem::IN_PROGRESS) {
download_util::PaintDownloadProgress(&canvas,
allocation.x, allocation.y,
progress_angle_,
« no previous file with comments | « chrome/browser/ui/gtk/custom_drag.cc ('k') | chrome/browser/ui/gtk/download/download_shelf_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698