| 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 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 692 PaintImages(canvas, | 692 PaintImages(canvas, |
| 693 body_image_set->top_right, body_image_set->right, | 693 body_image_set->top_right, body_image_set->right, |
| 694 body_image_set->bottom_right, | 694 body_image_set->bottom_right, |
| 695 x, box_y_, box_height_, body_image_set->top_right->width()); | 695 x, box_y_, box_height_, body_image_set->top_right->width()); |
| 696 | 696 |
| 697 // Overlay our body hot state. Warning dialogs don't display body a hot state. | 697 // Overlay our body hot state. Warning dialogs don't display body a hot state. |
| 698 if (!IsShowingWarningDialog() && | 698 if (!IsShowingWarningDialog() && |
| 699 body_hover_animation_->GetCurrentValue() > 0) { | 699 body_hover_animation_->GetCurrentValue() > 0) { |
| 700 canvas->SaveLayerAlpha( | 700 canvas->SaveLayerAlpha( |
| 701 static_cast<int>(body_hover_animation_->GetCurrentValue() * 255)); | 701 static_cast<int>(body_hover_animation_->GetCurrentValue() * 255)); |
| 702 canvas->sk_canvas()->drawARGB(0, 255, 255, 255, SkXfermode::kClear_Mode); | |
| 703 | 702 |
| 704 int x = kLeftPadding; | 703 int x = kLeftPadding; |
| 705 PaintImages(canvas, | 704 PaintImages(canvas, |
| 706 hot_body_image_set_.top_left, hot_body_image_set_.left, | 705 hot_body_image_set_.top_left, hot_body_image_set_.left, |
| 707 hot_body_image_set_.bottom_left, | 706 hot_body_image_set_.bottom_left, |
| 708 x, box_y_, box_height_, hot_body_image_set_.top_left->width()); | 707 x, box_y_, box_height_, hot_body_image_set_.top_left->width()); |
| 709 x += body_image_set->top_left->width(); | 708 x += body_image_set->top_left->width(); |
| 710 PaintImages(canvas, | 709 PaintImages(canvas, |
| 711 hot_body_image_set_.top, hot_body_image_set_.center, | 710 hot_body_image_set_.top, hot_body_image_set_.center, |
| 712 hot_body_image_set_.bottom, | 711 hot_body_image_set_.bottom, |
| (...skipping 13 matching lines...) Expand all Loading... |
| 726 if (drop_down_image_set) { | 725 if (drop_down_image_set) { |
| 727 PaintImages(canvas, | 726 PaintImages(canvas, |
| 728 drop_down_image_set->top, drop_down_image_set->center, | 727 drop_down_image_set->top, drop_down_image_set->center, |
| 729 drop_down_image_set->bottom, | 728 drop_down_image_set->bottom, |
| 730 x, box_y_, box_height_, drop_down_image_set->top->width()); | 729 x, box_y_, box_height_, drop_down_image_set->top->width()); |
| 731 | 730 |
| 732 // Overlay our drop-down hot state. | 731 // Overlay our drop-down hot state. |
| 733 if (drop_hover_animation_->GetCurrentValue() > 0) { | 732 if (drop_hover_animation_->GetCurrentValue() > 0) { |
| 734 canvas->SaveLayerAlpha( | 733 canvas->SaveLayerAlpha( |
| 735 static_cast<int>(drop_hover_animation_->GetCurrentValue() * 255)); | 734 static_cast<int>(drop_hover_animation_->GetCurrentValue() * 255)); |
| 736 canvas->sk_canvas()->drawARGB(0, 255, 255, 255, SkXfermode::kClear_Mode); | |
| 737 | 735 |
| 738 PaintImages(canvas, | 736 PaintImages(canvas, |
| 739 drop_down_image_set->top, drop_down_image_set->center, | 737 drop_down_image_set->top, drop_down_image_set->center, |
| 740 drop_down_image_set->bottom, | 738 drop_down_image_set->bottom, |
| 741 x, box_y_, box_height_, drop_down_image_set->top->width()); | 739 x, box_y_, box_height_, drop_down_image_set->top->width()); |
| 742 | 740 |
| 743 canvas->Restore(); | 741 canvas->Restore(); |
| 744 } | 742 } |
| 745 } | 743 } |
| 746 | 744 |
| (...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1228 void DownloadItemView::AnimateStateTransition(State from, State to, | 1226 void DownloadItemView::AnimateStateTransition(State from, State to, |
| 1229 ui::SlideAnimation* animation) { | 1227 ui::SlideAnimation* animation) { |
| 1230 if (from == NORMAL && to == HOT) { | 1228 if (from == NORMAL && to == HOT) { |
| 1231 animation->Show(); | 1229 animation->Show(); |
| 1232 } else if (from == HOT && to == NORMAL) { | 1230 } else if (from == HOT && to == NORMAL) { |
| 1233 animation->Hide(); | 1231 animation->Hide(); |
| 1234 } else if (from != to) { | 1232 } else if (from != to) { |
| 1235 animation->Reset((to == HOT) ? 1.0 : 0.0); | 1233 animation->Reset((to == HOT) ? 1.0 : 0.0); |
| 1236 } | 1234 } |
| 1237 } | 1235 } |
| OLD | NEW |