Commit 651b61fd authored by Orin Jaworski's avatar Orin Jaworski Committed by Commit Bot

Use content bounds size for ink drop highlight

The new tab button ink drop needed a larger size than the default
and overriding to pass bounds size corrected a rendering artifact
on the highlight.

Bug: 853700
Change-Id: Iff98f43049df3fa0c7142c3213707f423b6b1c14
Reviewed-on: https://chromium-review.googlesource.com/1105487
Commit-Queue: Orin Jaworski <orinj@chromium.org>
Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568520}
parent 8f4ffc9a
......@@ -212,11 +212,18 @@ void NewTabButton::RemoveInkDropLayer(ui::Layer* ink_drop_layer) {
std::unique_ptr<views::InkDropRipple> NewTabButton::CreateInkDropRipple()
const {
return std::make_unique<views::FloodFillInkDropRipple>(
GetVisibleBounds().size(), gfx::Insets(),
GetContentsBounds().size(), gfx::Insets(),
GetInkDropCenterBasedOnLastEvent(), GetInkDropBaseColor(),
ink_drop_visible_opacity());
}
std::unique_ptr<views::InkDropHighlight> NewTabButton::CreateInkDropHighlight()
const {
const gfx::Rect bounds = GetContentsBounds();
return CreateDefaultInkDropHighlight(
gfx::RectF(GetMirroredRect(bounds)).CenterPoint(), bounds.size());
}
void NewTabButton::NotifyClick(const ui::Event& event) {
ImageButton::NotifyClick(event);
GetInkDrop()->AnimateToState(views::InkDropState::ACTION_TRIGGERED);
......
......@@ -71,6 +71,8 @@ class NewTabButton : public views::ImageButton,
void AddInkDropLayer(ui::Layer* ink_drop_layer) override;
void RemoveInkDropLayer(ui::Layer* ink_drop_layer) override;
std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override;
std::unique_ptr<views::InkDropHighlight> CreateInkDropHighlight()
const override;
void NotifyClick(const ui::Event& event) override;
std::unique_ptr<views::InkDrop> CreateInkDrop() override;
std::unique_ptr<views::InkDropMask> CreateInkDropMask() const override;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment