| Index: ui/views/animation/ink_drop_host_view.cc
|
| diff --git a/ui/views/animation/ink_drop_host_view.cc b/ui/views/animation/ink_drop_host_view.cc
|
| index 1856e89293eba6056dd9d15d57940c5afcc7ddc9..25ab50ad5f5b14d30a2f71b9b12e1fe6195c22c7 100644
|
| --- a/ui/views/animation/ink_drop_host_view.cc
|
| +++ b/ui/views/animation/ink_drop_host_view.cc
|
| @@ -5,10 +5,12 @@
|
| #include "ui/views/animation/ink_drop_host_view.h"
|
|
|
| #include "base/memory/ptr_util.h"
|
| +#include "ui/base/material_design/material_design_controller.h"
|
| #include "ui/events/event.h"
|
| #include "ui/events/scoped_target_handler.h"
|
| #include "ui/gfx/color_palette.h"
|
| #include "ui/gfx/geometry/size_conversions.h"
|
| +#include "ui/views/animation/flood_fill_ink_drop_ripple.h"
|
| #include "ui/views/animation/ink_drop.h"
|
| #include "ui/views/animation/ink_drop_highlight.h"
|
| #include "ui/views/animation/ink_drop_impl.h"
|
| @@ -25,7 +27,13 @@ namespace {
|
| const float kLargeInkDropScale = 1.333f;
|
|
|
| // Default opacity of the ink drop when it is visible.
|
| -const float kInkDropVisibleOpacity = 0.175f;
|
| +float DefaultInkDropVisibleOpacity() {
|
| + constexpr float kInkDropVisibleOpacity = 0.175f;
|
| + constexpr float kInkDropVisibleOpacityMd = 0.05f;
|
| + return ui::MaterialDesignController::IsSecondaryUiMaterial()
|
| + ? kInkDropVisibleOpacityMd
|
| + : kInkDropVisibleOpacity;
|
| +}
|
|
|
| } // namespace
|
|
|
| @@ -118,7 +126,7 @@ gfx::Size InkDropHostView::CalculateLargeInkDropSize(
|
| InkDropHostView::InkDropHostView()
|
| : ink_drop_mode_(InkDropMode::OFF),
|
| ink_drop_(nullptr),
|
| - ink_drop_visible_opacity_(kInkDropVisibleOpacity),
|
| + ink_drop_visible_opacity_(DefaultInkDropVisibleOpacity()),
|
| old_paint_to_layer_(false),
|
| destroying_(false) {}
|
|
|
| @@ -172,16 +180,25 @@ std::unique_ptr<InkDropRipple> InkDropHostView::CreateDefaultInkDropRipple(
|
| const gfx::Size& size) const {
|
| std::unique_ptr<InkDropRipple> ripple(new SquareInkDropRipple(
|
| CalculateLargeInkDropSize(size), kInkDropLargeCornerRadius, size,
|
| - kInkDropSmallCornerRadius, center_point, GetInkDropBaseColor(),
|
| + kInkDropSmallCornerRadius, center_point, GetInkDropBaseColorImpl(),
|
| ink_drop_visible_opacity()));
|
| return ripple;
|
| }
|
|
|
| +std::unique_ptr<InkDropRipple> InkDropHostView::CreateFloodFillInkDropRipple()
|
| + const {
|
| + return std::unique_ptr<InkDropRipple>(new FloodFillInkDropRipple(
|
| + gfx::Size(kDefaultInkDropSize, kDefaultInkDropSize),
|
| + GetInkDropCenterBasedOnLastEvent(), GetInkDropBaseColorImpl(),
|
| + ink_drop_visible_opacity()));
|
| +}
|
| +
|
| std::unique_ptr<InkDropHighlight>
|
| InkDropHostView::CreateDefaultInkDropHighlight(const gfx::PointF& center_point,
|
| const gfx::Size& size) const {
|
| - std::unique_ptr<InkDropHighlight> highlight(new InkDropHighlight(
|
| - size, kInkDropSmallCornerRadius, center_point, GetInkDropBaseColor()));
|
| + std::unique_ptr<InkDropHighlight> highlight(
|
| + new InkDropHighlight(size, kInkDropSmallCornerRadius, center_point,
|
| + GetInkDropBaseColorImpl()));
|
| highlight->set_explode_size(gfx::SizeF(CalculateLargeInkDropSize(size)));
|
| return highlight;
|
| }
|
| @@ -316,4 +333,10 @@ InkDropHostView::CreateDefaultFloodFillInkDropImpl() {
|
| return ink_drop;
|
| }
|
|
|
| +SkColor InkDropHostView::GetInkDropBaseColorImpl() const {
|
| + return ui::MaterialDesignController::IsSecondaryUiMaterial()
|
| + ? SK_ColorBLACK
|
| + : GetInkDropBaseColor();
|
| +}
|
| +
|
| } // namespace views
|
|
|