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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <vector> | 10 #include <vector> |
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
723 // Fetch the already-loaded icon. | 723 // Fetch the already-loaded icon. |
724 IconManager* im = g_browser_process->icon_manager(); | 724 IconManager* im = g_browser_process->icon_manager(); |
725 gfx::Image* icon = im->LookupIconFromFilepath(download()->GetTargetFilePath(), | 725 gfx::Image* icon = im->LookupIconFromFilepath(download()->GetTargetFilePath(), |
726 IconLoader::SMALL); | 726 IconLoader::SMALL); |
727 if (!icon) | 727 if (!icon) |
728 return; | 728 return; |
729 | 729 |
730 // Draw the icon image. | 730 // Draw the icon image. |
731 int icon_x = progress_x + DownloadShelf::kFiletypeIconOffset; | 731 int icon_x = progress_x + DownloadShelf::kFiletypeIconOffset; |
732 int icon_y = progress_y + DownloadShelf::kFiletypeIconOffset; | 732 int icon_y = progress_y + DownloadShelf::kFiletypeIconOffset; |
733 SkPaint paint; | 733 cc::PaintFlags paint; |
734 // Use an alpha to make the image look disabled. | 734 // Use an alpha to make the image look disabled. |
735 if (!enabled()) | 735 if (!enabled()) |
736 paint.setAlpha(120); | 736 paint.setAlpha(120); |
737 canvas->DrawImageInt(*icon->ToImageSkia(), icon_x, icon_y, paint); | 737 canvas->DrawImageInt(*icon->ToImageSkia(), icon_x, icon_y, paint); |
738 } | 738 } |
739 | 739 |
740 void DownloadItemView::OnFocus() { | 740 void DownloadItemView::OnFocus() { |
741 View::OnFocus(); | 741 View::OnFocus(); |
742 // We render differently when focused. | 742 // We render differently when focused. |
743 SchedulePaint(); | 743 SchedulePaint(); |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1124 SchedulePaint(); | 1124 SchedulePaint(); |
1125 } | 1125 } |
1126 | 1126 |
1127 SkColor DownloadItemView::GetTextColor() const { | 1127 SkColor DownloadItemView::GetTextColor() const { |
1128 return GetTextColorForThemeProvider(GetThemeProvider()); | 1128 return GetTextColorForThemeProvider(GetThemeProvider()); |
1129 } | 1129 } |
1130 | 1130 |
1131 SkColor DownloadItemView::GetDimmedTextColor() const { | 1131 SkColor DownloadItemView::GetDimmedTextColor() const { |
1132 return SkColorSetA(GetTextColor(), 0xC7); | 1132 return SkColorSetA(GetTextColor(), 0xC7); |
1133 } | 1133 } |
OLD | NEW |