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 a11d7ed032d861c5e6132e546fb860da4064ce00..6e3e8b85ad157100b3ad4ce7dca76335d9d73120 100644 |
--- a/chrome/browser/ui/views/download/download_item_view.cc |
+++ b/chrome/browser/ui/views/download/download_item_view.cc |
@@ -236,21 +236,16 @@ DownloadItemView::~DownloadItemView() { |
// Progress animation handlers. |
void DownloadItemView::StartDownloadProgress() { |
- if (progress_timer_.IsRunning()) |
+ if (progress_start_time_ != base::TimeTicks()) |
return; |
progress_start_time_ = base::TimeTicks::Now(); |
- progress_timer_.Start( |
- FROM_HERE, |
- base::TimeDelta::FromMilliseconds(DownloadShelf::kProgressRateMs), |
asanka
2015/12/18 03:39:16
Would you be willing to get rid of this 30ms timer
Evan Stade
2015/12/18 19:01:38
yea I meant to look at doing that, thanks for remi
Evan Stade
2015/12/29 18:50:49
This seems complicated enough that I'd want someon
|
- base::Bind(&DownloadItemView::SchedulePaint, base::Unretained(this))); |
} |
void DownloadItemView::StopDownloadProgress() { |
- if (!progress_timer_.IsRunning()) |
+ if (progress_start_time_ == base::TimeTicks()) |
return; |
previous_progress_elapsed_ += base::TimeTicks::Now() - progress_start_time_; |
progress_start_time_ = base::TimeTicks(); |
- progress_timer_.Stop(); |
} |
void DownloadItemView::OnExtractIconComplete(gfx::Image* icon_bitmap) { |
@@ -284,6 +279,7 @@ void DownloadItemView::OnDownloadUpdated(DownloadItem* download_item) { |
case DownloadItem::IN_PROGRESS: |
download()->IsPaused() ? |
StopDownloadProgress() : StartDownloadProgress(); |
+ SchedulePaint(); |
LoadIconIfItemPathChanged(); |
break; |
case DownloadItem::INTERRUPTED: |
@@ -327,11 +323,6 @@ void DownloadItemView::OnDownloadUpdated(DownloadItem* download_item) { |
} |
UpdateAccessibleName(); |
- |
- // We use the parent's (DownloadShelfView's) SchedulePaint, since there |
- // are spaces between each DownloadItemView that the parent is responsible |
- // for painting. |
- shelf_->SchedulePaint(); |
} |
void DownloadItemView::OnDownloadDestroyed(DownloadItem* download) { |