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

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

Issue 16018005: Use DownloadItem::GetState() in chrome/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 7 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_item_view.cc
diff --git a/chrome/browser/ui/views/download/download_item_view.cc b/chrome/browser/ui/views/download/download_item_view.cc
index dce9024addf28526035ea18e2601b44f7c47fa7e..6b70faf13bb8e88f892d1c61dd5fd5aac9e4541d 100644
--- a/chrome/browser/ui/views/download/download_item_view.cc
+++ b/chrome/browser/ui/views/download/download_item_view.cc
@@ -405,7 +405,7 @@ bool DownloadItemView::OnMouseDragged(const ui::MouseEvent& event) {
drag_start_point_ = event.location();
}
if (dragging_) {
- if (download()->IsComplete()) {
+ if (download()->GetState() == DownloadItem::COMPLETE) {
IconManager* im = g_browser_process->icon_manager();
gfx::Image* icon = im->LookupIconFromFilepath(
download()->GetTargetFilePath(), IconLoader::SMALL);
@@ -789,15 +789,18 @@ void DownloadItemView::OnPaint(gfx::Canvas* canvas) {
// triggered only when we think the status might change.
if (icon) {
if (!IsShowingWarningDialog()) {
- if (download()->IsInProgress()) {
+ DownloadItem::DownloadState state = download()->GetState();
+ if (state == DownloadItem::IN_PROGRESS) {
download_util::PaintDownloadProgress(canvas, this, 0, 0,
progress_angle_,
model_.PercentComplete(),
download_util::SMALL);
- } else if (download()->IsComplete() &&
+ } else if (state == DownloadItem::COMPLETE &&
complete_animation_.get() &&
complete_animation_->is_animating()) {
- if (download()->IsInterrupted()) {
+ // FIXME: This will be always false, verify how handling of
Paweł Hajdan Jr. 2013/05/28 16:55:59 We use TODO(username) for things like that. If yo
asanka 2013/05/28 18:43:15 +1 Something like this would work: else if (comp
+ // INTERRUPTED state should be done.
+ if (state == DownloadItem::INTERRUPTED) {
download_util::PaintDownloadInterrupted(canvas, this, 0, 0,
complete_animation_->GetCurrentValue(),
download_util::SMALL);

Powered by Google App Engine
This is Rietveld 408576698