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

Unified Diff: ui/views/controls/button/md_text_button.h

Issue 2001843002: Use ink drop hover for focus states on toolbar buttons and location (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: layout Created 4 years, 7 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 | « ui/views/controls/button/label_button_unittest.cc ('k') | ui/views/controls/button/md_text_button.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/button/md_text_button.h
diff --git a/ui/views/controls/button/md_text_button.h b/ui/views/controls/button/md_text_button.h
index cc85b26133653faab048a24c54d8758800011a5c..cd700dfab09d43014fb02c816b6687c296c4297f 100644
--- a/ui/views/controls/button/md_text_button.h
+++ b/ui/views/controls/button/md_text_button.h
@@ -36,11 +36,18 @@ class VIEWS_EXPORT MdTextButton : public LabelButton {
static MdTextButton* CreateMdButton(ButtonListener* listener,
const base::string16& text);
+ // Paint an MD-style focus ring on the given canvas at the given bounds.
+ static void PaintMdFocusRing(gfx::Canvas* canvas, View* view);
+
void SetCallToAction(CallToAction cta);
// LabelButton:
+ void Layout() override;
+ void OnFocus() override;
+ void OnBlur() override;
void OnNativeThemeChanged(const ui::NativeTheme* theme) override;
SkColor GetInkDropBaseColor() const override;
+ bool ShouldShowInkDropForFocus() const override;
void SetText(const base::string16& text) override;
void UpdateStyleToIndicateDefaultStatus() override;
@@ -50,7 +57,10 @@ class VIEWS_EXPORT MdTextButton : public LabelButton {
void UpdateColorsFromNativeTheme();
- ButtonInkDropDelegate ink_drop_delegate_;
+ // The MD-style focus ring. This is not done via a FocusPainter
+ // because it needs to paint to a layer so it can extend beyond the bounds of
+ // |this|.
+ views::View* focus_ring_;
// The call to action style for this button.
CallToAction cta_;
« no previous file with comments | « ui/views/controls/button/label_button_unittest.cc ('k') | ui/views/controls/button/md_text_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698