| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/views/animation/ink_drop.h" | 5 #include "ui/views/animation/ink_drop.h" |
| 6 | 6 |
| 7 namespace views { | 7 namespace views { |
| 8 | 8 |
| 9 InkDrop::~InkDrop() {} |
| 10 |
| 11 void InkDrop::AddObserver(InkDropObserver* observer) { |
| 12 CHECK(observer); |
| 13 observers_.AddObserver(observer); |
| 14 } |
| 15 |
| 16 void InkDrop::RemoveObserver(InkDropObserver* observer) { |
| 17 CHECK(observer); |
| 18 observers_.RemoveObserver(observer); |
| 19 } |
| 20 |
| 21 InkDrop::InkDrop() {} |
| 22 |
| 9 InkDropContainerView::InkDropContainerView() {} | 23 InkDropContainerView::InkDropContainerView() {} |
| 10 | 24 |
| 11 void InkDropContainerView::AddInkDropLayer(ui::Layer* ink_drop_layer) { | 25 void InkDropContainerView::AddInkDropLayer(ui::Layer* ink_drop_layer) { |
| 12 SetPaintToLayer(); | 26 SetPaintToLayer(); |
| 13 SetVisible(true); | 27 SetVisible(true); |
| 14 layer()->SetFillsBoundsOpaquely(false); | 28 layer()->SetFillsBoundsOpaquely(false); |
| 15 layer()->Add(ink_drop_layer); | 29 layer()->Add(ink_drop_layer); |
| 16 } | 30 } |
| 17 | 31 |
| 18 void InkDropContainerView::RemoveInkDropLayer(ui::Layer* ink_drop_layer) { | 32 void InkDropContainerView::RemoveInkDropLayer(ui::Layer* ink_drop_layer) { |
| 19 layer()->Remove(ink_drop_layer); | 33 layer()->Remove(ink_drop_layer); |
| 20 SetVisible(false); | 34 SetVisible(false); |
| 21 DestroyLayer(); | 35 DestroyLayer(); |
| 22 } | 36 } |
| 23 | 37 |
| 24 bool InkDropContainerView::CanProcessEventsWithinSubtree() const { | 38 bool InkDropContainerView::CanProcessEventsWithinSubtree() const { |
| 25 // Ensure the container View is found as the EventTarget instead of this. | 39 // Ensure the container View is found as the EventTarget instead of this. |
| 26 return false; | 40 return false; |
| 27 } | 41 } |
| 28 | 42 |
| 29 } // namespace views | 43 } // namespace views |
| OLD | NEW |