1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_CONTROLLER_IMPL_H_
6 #define UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_CONTROLLER_IMPL_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "ui/gfx/geometry/rect.h"
10 #include "ui/gfx/geometry/size.h"
11 #include "ui/views/animation/ink_drop_animation_controller.h"
12 #include "ui/views/views_export.h"
15 class InkDropAnimation
;
18 // Controls an ink drop animation which is hosted by an InkDropHost.
19 class VIEWS_EXPORT InkDropAnimationControllerImpl
20 : public InkDropAnimationController
{
22 // Constructs an ink drop controller that will attach the ink drop to the
23 // given |ink_drop_host|.
24 explicit InkDropAnimationControllerImpl(InkDropHost
* ink_drop_host
);
25 ~InkDropAnimationControllerImpl() override
;
27 // InkDropAnimationController:
28 void AnimateToState(InkDropState state
) override
;
29 void SetInkDropSize(const gfx::Size
& size
) override
;
30 gfx::Rect
GetInkDropBounds() const override
;
31 void SetInkDropBounds(const gfx::Rect
& bounds
) override
;
34 // The host of the ink drop.
35 InkDropHost
* ink_drop_host_
;
37 // TODO(bruthig): It will be expensive to maintain InkDropAnimation instances
38 // when they are not actually being used. Consider creating InkDropAnimations
39 // on an as-needed basis and if construction is also expensive then consider
40 // creating an InkDropAnimationPool. See www.crbug.com/522175.
41 scoped_ptr
<InkDropAnimation
> ink_drop_animation_
;
43 DISALLOW_COPY_AND_ASSIGN(InkDropAnimationControllerImpl
);
48 #endif // UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_CONTROLLER_IMPL_H_