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 // A functional implementation of an InkDropAnimationController.
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 InkDropState
GetInkDropState() const override
;
29 void AnimateToState(InkDropState state
) override
;
30 gfx::Size
GetInkDropLargeSize() const override
;
31 void SetInkDropSize(const gfx::Size
& large_size
,
32 int large_corner_radius
,
33 const gfx::Size
& small_size
,
34 int small_corner_radius
) override
;
35 void SetInkDropCenter(const gfx::Point
& center_point
) override
;
38 // Creates a new InkDropAnimation and sets it to |ink_drop_animation_|. If
39 // |ink_drop_animation_| wasn't null then it will be removed from the
41 void CreateInkDropAnimation();
43 // The host of the ink drop.
44 InkDropHost
* ink_drop_host_
;
46 // Cached size for the ink drop's large size animations.
47 gfx::Size ink_drop_large_size_
;
49 // Cached corner radius for the ink drop's large size animations.
50 int ink_drop_large_corner_radius_
;
52 // Cached size for the ink drop's small size animations.
53 gfx::Size ink_drop_small_size_
;
55 // Cached corner radius for the ink drop's small size animations.
56 int ink_drop_small_corner_radius_
;
58 // Cached center point for the ink drop.
59 gfx::Point ink_drop_center_
;
61 // The current InkDropAnimation. Created on demand using
62 // CreateInkDropAnimation().
63 scoped_ptr
<InkDropAnimation
> ink_drop_animation_
;
65 DISALLOW_COPY_AND_ASSIGN(InkDropAnimationControllerImpl
);
70 #endif // UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_CONTROLLER_IMPL_H_