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 89f320d2a50664a66dac3f9aafdfd320ef91dceb..bcb43aca11570163a6fd7a764df2e971c22edb53 100644 |
--- a/ui/views/animation/ink_drop_host_view.cc |
+++ b/ui/views/animation/ink_drop_host_view.cc |
@@ -108,6 +108,7 @@ class InkDropHostView::InkDropGestureHandler : public ui::EventHandler { |
InkDropHostView::InkDropHostView() |
: ink_drop_(new InkDropStub()), |
+ ink_drop_layer_(nullptr), |
ink_drop_size_(kInkDropSize, kInkDropSize), |
ink_drop_visible_opacity_(kInkDropVisibleOpacity), |
old_paint_to_layer_(false), |
@@ -125,6 +126,7 @@ void InkDropHostView::AddInkDropLayer(ui::Layer* ink_drop_layer) { |
layer()->SetFillsBoundsOpaquely(false); |
layer()->Add(ink_drop_layer); |
layer()->StackAtBottom(ink_drop_layer); |
+ ink_drop_layer_ = ink_drop_layer; |
} |
void InkDropHostView::RemoveInkDropLayer(ui::Layer* ink_drop_layer) { |
@@ -133,6 +135,8 @@ void InkDropHostView::RemoveInkDropLayer(ui::Layer* ink_drop_layer) { |
// would be wrong. |
if (destroying_) |
return; |
+ DCHECK_EQ(ink_drop_layer_, ink_drop_layer); |
+ ink_drop_layer_ = nullptr; |
layer()->Remove(ink_drop_layer); |
SetPaintToLayer(old_paint_to_layer_); |
} |
@@ -147,6 +151,14 @@ std::unique_ptr<InkDropHighlight> InkDropHostView::CreateInkDropHighlight() |
gfx::RectF(GetLocalBounds()).CenterPoint()); |
} |
+void InkDropHostView::OffsetInkDropRipple(const gfx::Vector2d& offset) { |
+ if (!ink_drop_layer_) |
+ return; |
+ gfx::Transform transform; |
+ transform.Translate(offset.x(), offset.y()); |
+ ink_drop_layer_->SetTransform(transform); |
+} |
+ |
std::unique_ptr<InkDropRipple> InkDropHostView::CreateDefaultInkDropRipple( |
const gfx::Point& center_point) const { |
std::unique_ptr<InkDropRipple> ripple(new SquareInkDropRipple( |