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

Unified Diff: chrome/browser/ui/views/bar_control_button.cc

Issue 1817253003: [MD] Use same focus ring on BarControlButton as MdTextButton. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 4 years, 9 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/bar_control_button.cc
diff --git a/chrome/browser/ui/views/bar_control_button.cc b/chrome/browser/ui/views/bar_control_button.cc
index eecd5186b365e18fd90fc46186759b24c171021b..cef871b2736449854f48a521da4baf2cc109979a 100644
--- a/chrome/browser/ui/views/bar_control_button.cc
+++ b/chrome/browser/ui/views/bar_control_button.cc
@@ -9,6 +9,7 @@
#include "ui/gfx/vector_icons_public.h"
#include "ui/views/animation/button_ink_drop_delegate.h"
#include "ui/views/border.h"
+#include "ui/views/painter.h"
namespace {
@@ -25,6 +26,8 @@ BarControlButton::BarControlButton(views::ButtonListener* listener)
set_has_ink_drop_action_on_click(true);
SetImageAlignment(views::ImageButton::ALIGN_CENTER,
views::ImageButton::ALIGN_MIDDLE);
+ SetFocusPainter(nullptr);
+ UseMdFocusRing();
}
BarControlButton::~BarControlButton() {}
@@ -50,6 +53,7 @@ void BarControlButton::OnThemeChanged() {
image = gfx::CreateVectorIcon(id_, 16, SkColorSetA(icon_color, 0xff / 2));
SetImage(views::CustomButton::STATE_DISABLED, &image);
set_ink_drop_base_color(icon_color);
+ SizeToPreferredSize();
sky 2016/03/22 15:31:40 What view has BarControlButton in it? I get nervou
Evan Stade 2016/03/22 17:35:44 infobarview, find bar, download shelf. The alterna
sky 2016/03/22 18:02:27 Doesn't find bar and the like need to relayout in
Evan Stade 2016/03/22 18:16:11 This code path gets hit as soon as BarControlButto
}
void BarControlButton::OnNativeThemeChanged(const ui::NativeTheme* theme) {
« no previous file with comments | « no previous file | chrome/browser/ui/views/infobars/infobar_view.cc » ('j') | ui/views/controls/button/custom_button.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698