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

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: " 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..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);
}
}
}
« 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