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

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

Issue 1860163003: Use MD-style focus indicator on DL shelf items. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months 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
Index: chrome/browser/ui/views/download/download_item_view_md.cc
diff --git a/chrome/browser/ui/views/download/download_item_view_md.cc b/chrome/browser/ui/views/download/download_item_view_md.cc
index 0d3082de0ae6d8e3c1c400175e42f5e4dee01cf8..ce8a4f969a2b40c080ec5f7801f8f750316a957f 100644
--- a/chrome/browser/ui/views/download/download_item_view_md.cc
+++ b/chrome/browser/ui/views/download/download_item_view_md.cc
@@ -462,6 +462,7 @@ void DownloadItemViewMd::GetAccessibleState(ui::AXViewState* state) {
void DownloadItemViewMd::OnThemeChanged() {
UpdateColorsFromTheme();
+ SchedulePaint();
}
void DownloadItemViewMd::AddInkDropLayer(ui::Layer* ink_drop_layer) {
@@ -588,13 +589,19 @@ void DownloadItemViewMd::AnimationProgressed(const gfx::Animation* animation) {
}
void DownloadItemViewMd::OnPaint(gfx::Canvas* canvas) {
+ // Make sure to draw |this| opaquely. Since the toolbar color can be partially
+ // transparent, start with an opaque black backdrop.
+ canvas->DrawColor(SK_ColorBLACK);
+ canvas->DrawColor(
+ GetThemeProvider()->GetColor(ThemeProperties::COLOR_TOOLBAR));
+
DrawStatusText(canvas);
DrawFilename(canvas);
DrawIcon(canvas);
OnPaintBorder(canvas);
if (HasFocus())
- canvas->DrawFocusRect(GetLocalBounds());
+ views::CustomButton::PaintMdFocusRing(canvas, this);
}
int DownloadItemViewMd::GetYForFilenameText() const {

Powered by Google App Engine
This is Rietveld 408576698