| Index: chrome/browser/ui/views/download/download_item_view_md.cc
|
| diff --git a/chrome/browser/ui/views/download/download_item_view_md.cc b/chrome/browser/ui/views/download/download_item_view_md.cc
|
| index 1fbd1304bc0bf058f54d7b44eed775fc87507d40..1ed2c606a8f339b05dd3e9d506c432b83b7bcfc4 100644
|
| --- a/chrome/browser/ui/views/download/download_item_view_md.cc
|
| +++ b/chrome/browser/ui/views/download/download_item_view_md.cc
|
| @@ -205,10 +205,10 @@ void DownloadItemViewMd::StartDownloadProgress() {
|
| if (progress_timer_.IsRunning())
|
| return;
|
| progress_start_time_ = base::TimeTicks::Now();
|
| - progress_timer_.Start(
|
| - FROM_HERE,
|
| - base::TimeDelta::FromMilliseconds(DownloadShelf::kProgressRateMs),
|
| - base::Bind(&DownloadItemViewMd::SchedulePaint, base::Unretained(this)));
|
| + progress_timer_.Start(FROM_HERE, base::TimeDelta::FromMilliseconds(
|
| + DownloadShelf::kProgressRateMs),
|
| + base::Bind(&DownloadItemViewMd::ProgressTimerFired,
|
| + base::Unretained(this)));
|
| }
|
|
|
| void DownloadItemViewMd::StopDownloadProgress() {
|
| @@ -257,6 +257,7 @@ void DownloadItemViewMd::OnDownloadUpdated(DownloadItem* download_item) {
|
| case DownloadItem::IN_PROGRESS:
|
| download()->IsPaused() ? StopDownloadProgress()
|
| : StartDownloadProgress();
|
| + SchedulePaint();
|
| LoadIconIfItemPathChanged();
|
| break;
|
| case DownloadItem::INTERRUPTED:
|
| @@ -300,11 +301,6 @@ void DownloadItemViewMd::OnDownloadUpdated(DownloadItem* download_item) {
|
| }
|
|
|
| UpdateAccessibleName();
|
| -
|
| - // We use the parent's (DownloadShelfView's) SchedulePaint, since there
|
| - // are spaces between each DownloadItemViewMd that the parent is responsible
|
| - // for painting.
|
| - shelf_->SchedulePaint();
|
| }
|
|
|
| void DownloadItemViewMd::OnDownloadDestroyed(DownloadItem* download) {
|
| @@ -1075,6 +1071,13 @@ void DownloadItemViewMd::AnimateStateTransition(
|
| }
|
| }
|
|
|
| +void DownloadItemViewMd::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();
|
| +}
|
| +
|
| SkColor DownloadItemViewMd::GetTextColor() {
|
| return GetTextColorForThemeProvider(GetThemeProvider());
|
| }
|
|
|