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

Side by Side 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: rebase 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/views/download/download_shelf_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/download/download_item_view_md.h" 5 #include "chrome/browser/ui/views/download/download_item_view_md.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <vector> 10 #include <vector>
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 canvas->DrawColor(SK_ColorBLACK); 597 canvas->DrawColor(SK_ColorBLACK);
598 canvas->DrawColor( 598 canvas->DrawColor(
599 GetThemeProvider()->GetColor(ThemeProperties::COLOR_TOOLBAR)); 599 GetThemeProvider()->GetColor(ThemeProperties::COLOR_TOOLBAR));
600 600
601 DrawStatusText(canvas); 601 DrawStatusText(canvas);
602 DrawFilename(canvas); 602 DrawFilename(canvas);
603 DrawIcon(canvas); 603 DrawIcon(canvas);
604 OnPaintBorder(canvas); 604 OnPaintBorder(canvas);
605 605
606 if (HasFocus()) 606 if (HasFocus())
607 canvas->DrawFocusRect(GetLocalBounds()); 607 views::CustomButton::PaintMdFocusRing(canvas, this);
608 } 608 }
609 609
610 int DownloadItemViewMd::GetYForFilenameText() const { 610 int DownloadItemViewMd::GetYForFilenameText() const {
611 int text_height = font_list_.GetBaseline(); 611 int text_height = font_list_.GetBaseline();
612 if (!status_text_.empty()) 612 if (!status_text_.empty())
613 text_height += kVerticalTextPadding + status_font_list_.GetBaseline(); 613 text_height += kVerticalTextPadding + status_font_list_.GetBaseline();
614 return (height() - text_height) / 2; 614 return (height() - text_height) / 2;
615 } 615 }
616 616
617 void DownloadItemViewMd::DrawStatusText(gfx::Canvas* canvas) { 617 void DownloadItemViewMd::DrawStatusText(gfx::Canvas* canvas) {
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
1113 SchedulePaint(); 1113 SchedulePaint();
1114 } 1114 }
1115 1115
1116 SkColor DownloadItemViewMd::GetTextColor() const { 1116 SkColor DownloadItemViewMd::GetTextColor() const {
1117 return GetTextColorForThemeProvider(GetThemeProvider()); 1117 return GetTextColorForThemeProvider(GetThemeProvider());
1118 } 1118 }
1119 1119
1120 SkColor DownloadItemViewMd::GetDimmedTextColor() const { 1120 SkColor DownloadItemViewMd::GetDimmedTextColor() const {
1121 return SkColorSetA(GetTextColor(), 0xC7); 1121 return SkColorSetA(GetTextColor(), 0xC7);
1122 } 1122 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/download/download_shelf_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698