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

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

Issue 2311423002: Harmony - update button focus rings. (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « no previous file | ui/views/controls/button/md_text_button.h » ('j') | 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_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 9ed34ac9c4f6f9090f972b0d1931b341047a2e1b..aff9887e0e01f12dd2b2590b65063beb31c17e7f 100644
--- a/chrome/browser/ui/views/download/download_item_view_md.cc
+++ b/chrome/browser/ui/views/download/download_item_view_md.cc
@@ -65,6 +65,7 @@
#include "ui/views/border.h"
#include "ui/views/controls/button/image_button.h"
#include "ui/views/controls/button/md_text_button.h"
+#include "ui/views/controls/focusable_border.h"
#include "ui/views/controls/label.h"
#include "ui/views/mouse_constants.h"
#include "ui/views/widget/root_view.h"
@@ -126,12 +127,15 @@ const int kInterruptedAnimationDurationMs = 2500;
const int kDisabledOnOpenDuration = 3000;
// The separator is drawn as a border. It's one dp wide.
-class SeparatorBorder : public views::Border {
+class SeparatorBorder : public views::FocusableBorder {
public:
explicit SeparatorBorder(SkColor color) : color_(color) {}
~SeparatorBorder() override {}
void Paint(const views::View& view, gfx::Canvas* canvas) override {
+ if (view.HasFocus())
+ return FocusableBorder::Paint(view, canvas);
+
int end_x = base::i18n::IsRTL() ? 0 : view.width() - 1;
canvas->DrawLine(gfx::Point(end_x, kTopBottomPadding),
gfx::Point(end_x, view.height() - kTopBottomPadding),
@@ -612,9 +616,6 @@ void DownloadItemViewMd::OnPaint(gfx::Canvas* canvas) {
DrawFilename(canvas);
DrawIcon(canvas);
OnPaintBorder(canvas);
-
- if (HasFocus())
- views::MdTextButton::PaintMdFocusRing(canvas, this, 1, SK_AlphaOPAQUE);
}
int DownloadItemViewMd::GetYForFilenameText() const {
« no previous file with comments | « no previous file | ui/views/controls/button/md_text_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698