| Index: ui/views/controls/button/label_button.cc
|
| diff --git a/ui/views/controls/button/label_button.cc b/ui/views/controls/button/label_button.cc
|
| index 3d7453d774e0ac997417f755789f7a5cb5059ea0..52457b744572a0d514f16f81ee8c49c814223fc5 100644
|
| --- a/ui/views/controls/button/label_button.cc
|
| +++ b/ui/views/controls/button/label_button.cc
|
| @@ -20,6 +20,7 @@
|
| #include "ui/native_theme/native_theme.h"
|
| #include "ui/views/animation/flood_fill_ink_drop_ripple.h"
|
| #include "ui/views/animation/ink_drop_highlight.h"
|
| +#include "ui/views/animation/ink_drop_impl.h"
|
| #include "ui/views/animation/square_ink_drop_ripple.h"
|
| #include "ui/views/background.h"
|
| #include "ui/views/controls/button/label_button_border.h"
|
| @@ -447,26 +448,29 @@ void LabelButton::RemoveInkDropLayer(ui::Layer* ink_drop_layer) {
|
| ink_drop_container_->SetVisible(false);
|
| }
|
|
|
| +std::unique_ptr<InkDrop> LabelButton::CreateInkDrop() {
|
| + return UseFloodFillInkDrop() ? CreateDefaultFloodFillInkDropImpl()
|
| + : CustomButton::CreateInkDrop();
|
| +}
|
| +
|
| std::unique_ptr<views::InkDropRipple> LabelButton::CreateInkDropRipple() const {
|
| - return GetText().empty()
|
| - ? CreateDefaultInkDropRipple(
|
| - image()->GetMirroredBounds().CenterPoint())
|
| - : base::MakeUnique<views::FloodFillInkDropRipple>(
|
| + return UseFloodFillInkDrop()
|
| + ? base::MakeUnique<views::FloodFillInkDropRipple>(
|
| GetLocalBounds(), GetInkDropCenterBasedOnLastEvent(),
|
| - GetInkDropBaseColor(), ink_drop_visible_opacity());
|
| + GetInkDropBaseColor(), ink_drop_visible_opacity())
|
| + : CreateDefaultInkDropRipple(
|
| + image()->GetMirroredBounds().CenterPoint());
|
| }
|
|
|
| std::unique_ptr<views::InkDropHighlight> LabelButton::CreateInkDropHighlight()
|
| const {
|
| - if (!ShouldShowInkDropHighlight())
|
| - return nullptr;
|
| - return GetText().empty()
|
| - ? CreateDefaultInkDropHighlight(
|
| - gfx::RectF(image()->GetMirroredBounds()).CenterPoint())
|
| - : base::MakeUnique<views::InkDropHighlight>(
|
| + return UseFloodFillInkDrop()
|
| + ? base::MakeUnique<views::InkDropHighlight>(
|
| size(), kInkDropSmallCornerRadius,
|
| gfx::RectF(GetLocalBounds()).CenterPoint(),
|
| - GetInkDropBaseColor());
|
| + GetInkDropBaseColor())
|
| + : CreateDefaultInkDropHighlight(
|
| + gfx::RectF(image()->GetMirroredBounds()).CenterPoint());
|
| }
|
|
|
| void LabelButton::StateChanged() {
|
| @@ -617,4 +621,8 @@ void LabelButton::ResetLabelEnabledColor() {
|
| label_->SetEnabledColor(color);
|
| }
|
|
|
| +bool LabelButton::UseFloodFillInkDrop() const {
|
| + return !GetText().empty();
|
| +}
|
| +
|
| } // namespace views
|
|
|