Commit 6f682af2 authored by asanka@chromium.org's avatar asanka@chromium.org

Fix the placement of dangerous download warning icons in DownloadItemView.

BUG=Dangerous download warning in download shelf shows icon a few pixels too low.
TEST=Start downloading something dangerous. Check that the warning icon is centered.


Review URL: http://codereview.chromium.org/8548016

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111167 0039d316-1c4b-4281-b951-d872f2087c98
parent 386e02f4
......@@ -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);
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment