Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(995)

Unified Diff: chrome/browser/ui/views/download/download_item_view.cc

Issue 8548016: Fix the placement of dangerous download warning icons in DownloadItemView. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..042e52555cdc19ff6f21d36e4af6c60c04ad92b4 100644
--- a/chrome/browser/ui/views/download/download_item_view.cc
+++ b/chrome/browser/ui/views/download/download_item_view.cc
@@ -825,17 +825,23 @@ 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 = kLeftPadding + body_image_set->top_left->width();
+ icon_y = (height() - icon->height()) / 2;
+ } else {
+ icon_x = download_util::kSmallProgressIconOffset;
+ icon_y = download_util::kSmallProgressIconOffset;
+ }
+ icon_x = GetMirroredXWithWidthInView(icon_x, icon->width());
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);
}
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698