Chromium Code Reviews| Index: ui/views/controls/button/md_text_button.cc |
| diff --git a/ui/views/controls/button/md_text_button.cc b/ui/views/controls/button/md_text_button.cc |
| index 32e33a6eb2d5aa2e02e7295f1f7cde7b42d60d8c..247e2a8ff5d22646af042a2e306bf3ca70b42c52 100644 |
| --- a/ui/views/controls/button/md_text_button.cc |
| +++ b/ui/views/controls/button/md_text_button.cc |
| @@ -16,6 +16,7 @@ |
| #include "ui/views/border.h" |
| #include "ui/views/controls/button/blue_button.h" |
| #include "ui/views/painter.h" |
| +#include "ui/views/style/platform_style.h" |
| namespace views { |
| @@ -178,6 +179,10 @@ std::unique_ptr<views::InkDropRipple> MdTextButton::CreateInkDropRipple() |
| GetInkDropBaseColor(), ink_drop_visible_opacity())); |
| } |
| +void MdTextButton::StateChanged() { |
| + UpdateColors(); |
|
sky
2016/08/25 23:44:50
Are you sure you don't need to call LabelButton::S
Elly Fong-Jones
2016/08/26 15:46:44
Nope, I totally do. Good catch.
|
| +} |
| + |
| std::unique_ptr<views::InkDropHighlight> MdTextButton::CreateInkDropHighlight() |
| const { |
| if (!ShouldShowInkDropHighlight()) |
| @@ -235,7 +240,8 @@ MdTextButton::MdTextButton(ButtonListener* listener) |
| : LabelButton(listener, base::string16()), |
| focus_ring_(new internal::MdFocusRing()), |
| is_cta_(false) { |
| - SetInkDropMode(InkDropMode::ON); |
| + SetInkDropMode(PlatformStyle::kUseRipples ? InkDropMode::ON |
| + : InkDropMode::OFF); |
| set_has_ink_drop_action_on_click(true); |
| SetHorizontalAlignment(gfx::ALIGN_CENTER); |
| SetFocusForPlatform(); |
| @@ -306,6 +312,8 @@ void MdTextButton::UpdateColors() { |
| ? color_utils::BlendTowardOppositeLuma(text_color, 0xD8) |
| : SK_ColorTRANSPARENT; |
| + bg_color = PlatformStyle::BackgroundColorForMdButton(bg_color, state()); |
| + |
| const SkAlpha kStrokeOpacity = 0x1A; |
| SkColor stroke_color = (is_cta_ || color_utils::IsDark(text_color)) |
| ? SkColorSetA(SK_ColorBLACK, kStrokeOpacity) |