OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/views/download/download_item_view.h" | 5 #include "chrome/browser/ui/views/download/download_item_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
799 if (icon) { | 799 if (icon) { |
800 if (!IsShowingWarningDialog()) { | 800 if (!IsShowingWarningDialog()) { |
801 if (download_->IsInProgress()) { | 801 if (download_->IsInProgress()) { |
802 download_util::PaintDownloadProgress(canvas, this, 0, 0, | 802 download_util::PaintDownloadProgress(canvas, this, 0, 0, |
803 progress_angle_, | 803 progress_angle_, |
804 model_->PercentComplete(), | 804 model_->PercentComplete(), |
805 download_util::SMALL); | 805 download_util::SMALL); |
806 } else if (download_->IsComplete() && | 806 } else if (download_->IsComplete() && |
807 complete_animation_.get() && | 807 complete_animation_.get() && |
808 complete_animation_->is_animating()) { | 808 complete_animation_->is_animating()) { |
809 if (download_->IsInterrupted()) { | |
810 download_util::PaintDownloadInterrupted(canvas, this, 0, 0, | |
811 complete_animation_->GetCurrentValue(), | |
812 download_util::SMALL); | |
813 } else { | |
814 download_util::PaintDownloadComplete(canvas, this, 0, 0, | 809 download_util::PaintDownloadComplete(canvas, this, 0, 0, |
815 complete_animation_->GetCurrentValue(), | 810 complete_animation_->GetCurrentValue(), |
816 download_util::SMALL); | 811 download_util::SMALL); |
817 } | 812 } else if (download_->IsInterrupted()) { |
| 813 download_util::PaintDownloadInterrupted(canvas, this, 0, 0, |
| 814 complete_animation_->GetCurrentValue(), |
| 815 download_util::SMALL); |
818 } | 816 } |
819 } | 817 } |
820 | 818 |
821 // Draw the icon image. | 819 // Draw the icon image. |
822 int icon_x, icon_y; | 820 int icon_x, icon_y; |
823 | 821 |
824 if (IsShowingWarningDialog()) { | 822 if (IsShowingWarningDialog()) { |
825 icon_x = kLeftPadding + body_image_set->top_left->width(); | 823 icon_x = kLeftPadding + body_image_set->top_left->width(); |
826 icon_y = (height() - icon->height()) / 2; | 824 icon_y = (height() - icon->height()) / 2; |
827 } else { | 825 } else { |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1223 void DownloadItemView::AnimateStateTransition(State from, State to, | 1221 void DownloadItemView::AnimateStateTransition(State from, State to, |
1224 ui::SlideAnimation* animation) { | 1222 ui::SlideAnimation* animation) { |
1225 if (from == NORMAL && to == HOT) { | 1223 if (from == NORMAL && to == HOT) { |
1226 animation->Show(); | 1224 animation->Show(); |
1227 } else if (from == HOT && to == NORMAL) { | 1225 } else if (from == HOT && to == NORMAL) { |
1228 animation->Hide(); | 1226 animation->Hide(); |
1229 } else if (from != to) { | 1227 } else if (from != to) { |
1230 animation->Reset((to == HOT) ? 1.0 : 0.0); | 1228 animation->Reset((to == HOT) ? 1.0 : 0.0); |
1231 } | 1229 } |
1232 } | 1230 } |
OLD | NEW |