OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_CONTROLLER_H_ | 5 #ifndef UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_CONTROLLER_H_ |
6 #define UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_CONTROLLER_H_ | 6 #define UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_CONTROLLER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
11 #include "ui/compositor/layer_tree_owner.h" | 11 #include "ui/compositor/layer_tree_owner.h" |
12 #include "ui/events/event_handler.h" | 12 #include "ui/events/event_handler.h" |
13 #include "ui/gfx/geometry/rect.h" | 13 #include "ui/gfx/geometry/rect.h" |
14 #include "ui/gfx/geometry/size.h" | 14 #include "ui/gfx/geometry/size.h" |
15 #include "ui/views/animation/ink_drop_state.h" | 15 #include "ui/views/animation/ink_drop_state.h" |
16 #include "ui/views/views_export.h" | 16 #include "ui/views/views_export.h" |
17 | 17 |
18 namespace ui { | 18 namespace ui { |
19 class Layer; | 19 class Layer; |
20 } | 20 } |
21 | 21 |
22 namespace views { | 22 namespace views { |
23 | 23 |
24 // Pure virtual base class that manages an ink drop animation's lifetime and | 24 // Pure virtual base class that manages the lifetime and state of an ink drop |
25 // state. | 25 // animation as well as visual hover state feedback. |
26 class VIEWS_EXPORT InkDropAnimationController { | 26 class VIEWS_EXPORT InkDropAnimationController { |
27 public: | 27 public: |
28 virtual ~InkDropAnimationController() {} | 28 virtual ~InkDropAnimationController() {} |
29 | 29 |
30 // Gets the current state of the ink drop. | 30 // Gets the current state of the ink drop. |
31 virtual InkDropState GetInkDropState() const = 0; | 31 virtual InkDropState GetInkDropState() const = 0; |
32 | 32 |
33 // Animates from the current InkDropState to |ink_drop_state|. | 33 // Animates from the current InkDropState to |ink_drop_state|. |
34 virtual void AnimateToState(InkDropState ink_drop_state) = 0; | 34 virtual void AnimateToState(InkDropState ink_drop_state) = 0; |
35 | 35 |
| 36 // Enables or disables the hover state. |
| 37 virtual void SetHovered(bool is_hovered) = 0; |
| 38 |
| 39 // Returns true if the hover state is enabled. |
| 40 virtual bool IsHovered() const = 0; |
| 41 |
36 virtual gfx::Size GetInkDropLargeSize() const = 0; | 42 virtual gfx::Size GetInkDropLargeSize() const = 0; |
37 | 43 |
38 // Sets the different sizes of the ink drop. | 44 // Sets the different sizes of the ink drop. |
39 virtual void SetInkDropSize(const gfx::Size& large_size, | 45 virtual void SetInkDropSize(const gfx::Size& large_size, |
40 int large_corner_radius, | 46 int large_corner_radius, |
41 const gfx::Size& small_size, | 47 const gfx::Size& small_size, |
42 int small_corner_radius) = 0; | 48 int small_corner_radius) = 0; |
43 | 49 |
44 // Sets the |center_point| of the ink drop relative to its parent Layer. | 50 // Sets the |center_point| of the ink drop relative to its parent Layer. |
45 virtual void SetInkDropCenter(const gfx::Point& center_point) = 0; | 51 virtual void SetInkDropCenter(const gfx::Point& center_point) = 0; |
46 | 52 |
47 protected: | 53 protected: |
48 InkDropAnimationController() {} | 54 InkDropAnimationController() {} |
49 | 55 |
50 private: | 56 private: |
51 DISALLOW_COPY_AND_ASSIGN(InkDropAnimationController); | 57 DISALLOW_COPY_AND_ASSIGN(InkDropAnimationController); |
52 }; | 58 }; |
53 | 59 |
54 } // namespace views | 60 } // namespace views |
55 | 61 |
56 #endif // UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_CONTROLLER_H_ | 62 #endif // UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_CONTROLLER_H_ |
OLD | NEW |