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 791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
802 if (icon) { | 802 if (icon) { |
803 if (!IsShowingWarningDialog()) { | 803 if (!IsShowingWarningDialog()) { |
804 if (download_->IsInProgress()) { | 804 if (download_->IsInProgress()) { |
805 download_util::PaintDownloadProgress(canvas, this, 0, 0, | 805 download_util::PaintDownloadProgress(canvas, this, 0, 0, |
806 progress_angle_, | 806 progress_angle_, |
807 model_->PercentComplete(), | 807 model_->PercentComplete(), |
808 download_util::SMALL); | 808 download_util::SMALL); |
809 } else if (download_->IsComplete() && | 809 } else if (download_->IsComplete() && |
810 complete_animation_.get() && | 810 complete_animation_.get() && |
811 complete_animation_->is_animating()) { | 811 complete_animation_->is_animating()) { |
812 if (download_->IsInterrupted()) { | |
813 download_util::PaintDownloadInterrupted(canvas, this, 0, 0, | |
814 complete_animation_->GetCurrentValue(), | |
815 download_util::SMALL); | |
816 } else { | |
817 download_util::PaintDownloadComplete(canvas, this, 0, 0, | 812 download_util::PaintDownloadComplete(canvas, this, 0, 0, |
818 complete_animation_->GetCurrentValue(), | 813 complete_animation_->GetCurrentValue(), |
819 download_util::SMALL); | 814 download_util::SMALL); |
820 } | 815 } else if (download_->IsInterrupted()) { |
benjhayden
2012/10/15 17:59:37
Woah, nice catch!
I presume this is purely a bug f
| |
816 download_util::PaintDownloadInterrupted(canvas, this, 0, 0, | |
817 complete_animation_->GetCurrentValue(), | |
818 download_util::SMALL); | |
821 } | 819 } |
822 } | 820 } |
823 | 821 |
824 // Draw the icon image. | 822 // Draw the icon image. |
825 int icon_x, icon_y; | 823 int icon_x, icon_y; |
826 | 824 |
827 if (IsShowingWarningDialog()) { | 825 if (IsShowingWarningDialog()) { |
828 icon_x = kLeftPadding + body_image_set->top_left->width(); | 826 icon_x = kLeftPadding + body_image_set->top_left->width(); |
829 icon_y = (height() - icon->height()) / 2; | 827 icon_y = (height() - icon->height()) / 2; |
830 } else { | 828 } else { |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1226 void DownloadItemView::AnimateStateTransition(State from, State to, | 1224 void DownloadItemView::AnimateStateTransition(State from, State to, |
1227 ui::SlideAnimation* animation) { | 1225 ui::SlideAnimation* animation) { |
1228 if (from == NORMAL && to == HOT) { | 1226 if (from == NORMAL && to == HOT) { |
1229 animation->Show(); | 1227 animation->Show(); |
1230 } else if (from == HOT && to == NORMAL) { | 1228 } else if (from == HOT && to == NORMAL) { |
1231 animation->Hide(); | 1229 animation->Hide(); |
1232 } else if (from != to) { | 1230 } else if (from != to) { |
1233 animation->Reset((to == HOT) ? 1.0 : 0.0); | 1231 animation->Reset((to == HOT) ? 1.0 : 0.0); |
1234 } | 1232 } |
1235 } | 1233 } |
OLD | NEW |