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_H_ | 5 #ifndef UI_VIEWS_ANIMATION_INK_DROP_H_ |
6 #define UI_VIEWS_ANIMATION_INK_DROP_H_ | 6 #define UI_VIEWS_ANIMATION_INK_DROP_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 | 24 |
25 // Pure virtual base class that manages the lifetime and state of an ink drop | 25 // Pure virtual base class that manages the lifetime and state of an ink drop |
26 // ripple as well as visual hover state feedback. | 26 // ripple as well as visual hover state feedback. |
27 class VIEWS_EXPORT InkDrop { | 27 class VIEWS_EXPORT InkDrop { |
28 public: | 28 public: |
29 virtual ~InkDrop() {} | 29 virtual ~InkDrop() {} |
30 | 30 |
31 // Gets the target state of the ink drop. | 31 // Gets the target state of the ink drop. |
32 virtual InkDropState GetTargetInkDropState() const = 0; | 32 virtual InkDropState GetTargetInkDropState() const = 0; |
33 | 33 |
34 // Returns true when the ripple is visible, including when animating to | |
35 // HIDDEN. | |
36 virtual bool IsVisible() const = 0; | |
37 | |
38 // Animates from the current InkDropState to |ink_drop_state|. | 34 // Animates from the current InkDropState to |ink_drop_state|. |
39 virtual void AnimateToState(InkDropState ink_drop_state) = 0; | 35 virtual void AnimateToState(InkDropState ink_drop_state) = 0; |
40 | 36 |
41 // Immediately snaps the InkDropState to ACTIVATED. This more specific | 37 // Immediately snaps the InkDropState to ACTIVATED. This more specific |
42 // implementation of the non-existent SnapToState(InkDropState) function is | 38 // implementation of the non-existent SnapToState(InkDropState) function is |
43 // the only one available because it was the only InkDropState that clients | 39 // the only one available because it was the only InkDropState that clients |
44 // needed to skip animations for. | 40 // needed to skip animations for. |
45 virtual void SnapToActivated() = 0; | 41 virtual void SnapToActivated() = 0; |
46 | 42 |
47 // Enables or disables the hover state. | 43 // Enables or disables the hover state. |
48 virtual void SetHovered(bool is_hovered) = 0; | 44 virtual void SetHovered(bool is_hovered) = 0; |
49 | 45 |
50 // Enables or disables the focus state. | 46 // Enables or disables the focus state. |
51 virtual void SetFocused(bool is_focused) = 0; | 47 virtual void SetFocused(bool is_focused) = 0; |
52 | 48 |
53 protected: | 49 protected: |
54 InkDrop() {} | 50 InkDrop() {} |
55 | 51 |
56 private: | 52 private: |
57 DISALLOW_COPY_AND_ASSIGN(InkDrop); | 53 DISALLOW_COPY_AND_ASSIGN(InkDrop); |
58 }; | 54 }; |
59 | 55 |
60 } // namespace views | 56 } // namespace views |
61 | 57 |
62 #endif // UI_VIEWS_ANIMATION_INK_DROP_H_ | 58 #endif // UI_VIEWS_ANIMATION_INK_DROP_H_ |
OLD | NEW |