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 20778df043687457b2187fcd773e99ac1786020b..121834e8d472a9ef6a2fe2d208852da6549a2cc8 100644 |
--- a/chrome/browser/ui/views/download/download_item_view.cc |
+++ b/chrome/browser/ui/views/download/download_item_view.cc |
@@ -241,10 +241,10 @@ void DownloadItemView::StartDownloadProgress() { |
if (progress_timer_.IsRunning()) |
return; |
progress_start_time_ = base::TimeTicks::Now(); |
- progress_timer_.Start( |
- FROM_HERE, |
- base::TimeDelta::FromMilliseconds(DownloadShelf::kProgressRateMs), |
- base::Bind(&DownloadItemView::SchedulePaint, base::Unretained(this))); |
+ progress_timer_.Start(FROM_HERE, base::TimeDelta::FromMilliseconds( |
+ DownloadShelf::kProgressRateMs), |
+ base::Bind(&DownloadItemView::ProgressTimerFired, |
+ base::Unretained(this))); |
} |
void DownloadItemView::StopDownloadProgress() { |
@@ -286,6 +286,7 @@ void DownloadItemView::OnDownloadUpdated(DownloadItem* download_item) { |
case DownloadItem::IN_PROGRESS: |
download()->IsPaused() ? |
StopDownloadProgress() : StartDownloadProgress(); |
+ SchedulePaint(); |
LoadIconIfItemPathChanged(); |
break; |
case DownloadItem::INTERRUPTED: |
@@ -329,11 +330,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) { |
@@ -1398,3 +1394,10 @@ void DownloadItemView::AnimateStateTransition(State from, State to, |
animation->Reset((to == HOT) ? 1.0 : 0.0); |
} |
} |
+ |
+void DownloadItemView::ProgressTimerFired() { |
+ // Only repaint for the indeterminate size case. Otherwise, we'll repaint only |
+ // when there's an update notified via OnDownloadUpdated(). |
+ if (model_.PercentComplete() < 0) |
+ SchedulePaint(); |
Evan Stade
2016/01/06 19:34:10
I reverted the change for indeterminate size downl
asanka
2016/01/06 19:44:28
Understood. I agree that we aren't conveying 30fps
|
+} |