| Index: ui/views/view.cc
|
| diff --git a/ui/views/view.cc b/ui/views/view.cc
|
| index 46bb7be9d230e22aa84dff30ff9952cc16e9fbdf..d0eeb50518ecbeef3d10f2f9f1dfc5c0f3244314 100644
|
| --- a/ui/views/view.cc
|
| +++ b/ui/views/view.cc
|
| @@ -39,6 +39,7 @@
|
| #include "ui/gfx/transform.h"
|
| #include "ui/native_theme/native_theme.h"
|
| #include "ui/views/accessibility/native_view_accessibility.h"
|
| +#include "ui/views/animation/ink_drop_delegate.h"
|
| #include "ui/views/background.h"
|
| #include "ui/views/border.h"
|
| #include "ui/views/context_menu_controller.h"
|
| @@ -82,6 +83,28 @@ const View* GetHierarchyRoot(const View* view) {
|
| return root;
|
| }
|
|
|
| +// A stub InkDropDelegate implementation that always exists and does nothing.
|
| +// A real InkDropDelegate descendant can be returned by a View's descendant via
|
| +// GetInkDropDelegate().
|
| +class InkDropDelegateStub : public InkDropDelegate {
|
| + public:
|
| + InkDropDelegateStub() {}
|
| + ~InkDropDelegateStub() override {}
|
| +
|
| + // InkDropDelegate:
|
| + void SetInkDropSize(int large_size,
|
| + int large_corner_radius,
|
| + int small_size,
|
| + int small_corner_radius) override {}
|
| + void OnLayout() override {}
|
| + void OnAction(InkDropState state) override {}
|
| +
|
| + private:
|
| + DISALLOW_COPY_AND_ASSIGN(InkDropDelegateStub);
|
| +};
|
| +
|
| +static InkDropDelegateStub ink_drop_delegate_stub;
|
| +
|
| } // namespace
|
|
|
| // static
|
| @@ -519,6 +542,8 @@ void View::Layout() {
|
| child->Layout();
|
| }
|
| }
|
| +
|
| + GetInkDropDelegate()->OnLayout();
|
| }
|
|
|
| void View::InvalidateLayout() {
|
| @@ -1265,6 +1290,7 @@ int View::OnPerformDrop(const ui::DropTargetEvent& event) {
|
| }
|
|
|
| void View::OnDragDone() {
|
| + GetInkDropDelegate()->OnAction(InkDropState::HIDDEN);
|
| }
|
|
|
| // static
|
| @@ -1530,6 +1556,12 @@ void View::ReorderChildLayers(ui::Layer* parent_layer) {
|
| }
|
| }
|
|
|
| +// Animations ----------------------------------------------------------------
|
| +
|
| +InkDropDelegate* View::GetInkDropDelegate() const {
|
| + return &ink_drop_delegate_stub;
|
| +}
|
| +
|
| // Input -----------------------------------------------------------------------
|
|
|
| View::DragInfo* View::GetDragInfo() {
|
|
|