Chromium Code Reviews| Index: chrome/browser/ui/views/download/download_item_view.cc |
| diff --git a/chrome/browser/ui/views/download/download_item_view.cc b/chrome/browser/ui/views/download/download_item_view.cc |
| index 5bfb228b1440d7817c0c5c2c3fbad0520b333ca7..837cb3950d1ef65587073cc20dd36e9e7f14bb70 100644 |
| --- a/chrome/browser/ui/views/download/download_item_view.cc |
| +++ b/chrome/browser/ui/views/download/download_item_view.cc |
| @@ -825,17 +825,25 @@ void DownloadItemView::OnPaint(gfx::Canvas* canvas) { |
| } |
| // Draw the icon image. |
| - int mirrored_x = GetMirroredXWithWidthInView( |
| - download_util::kSmallProgressIconOffset, icon->width()); |
| + int icon_x, icon_y; |
| + |
| + if (IsDangerousMode()) { |
| + icon_x = GetMirroredXWithWidthInView( |
| + kLeftPadding + dangerous_mode_body_image_set_.top_left->width(), |
|
msw
2011/11/21 18:39:20
Is there a reason to add the 0px kLeftPadding here
msw
2011/11/21 18:39:20
Use the body_image_set local instead.
Can you cons
asanka
2011/11/21 20:45:32
Done.
asanka
2011/11/21 20:45:32
I'm mirroring the logic in DIV::Layout() and DIV::
|
| + icon->width()); |
| + icon_y = (height() - icon->height()) / 2; |
| + } else { |
| + icon_x = GetMirroredXWithWidthInView( |
| + download_util::kSmallProgressIconOffset, icon->width()); |
| + icon_y = download_util::kSmallProgressIconOffset; |
| + } |
| if (IsEnabled()) { |
| - canvas->DrawBitmapInt(*icon, mirrored_x, |
| - download_util::kSmallProgressIconOffset); |
| + canvas->DrawBitmapInt(*icon, icon_x, icon_y); |
| } else { |
| // Use an alpha to make the image look disabled. |
| SkPaint paint; |
| paint.setAlpha(120); |
| - canvas->DrawBitmapInt(*icon, mirrored_x, |
| - download_util::kSmallProgressIconOffset, paint); |
| + canvas->DrawBitmapInt(*icon, icon_x, icon_y, paint); |
| } |
| } |
| } |