| OLD | NEW |
| (Empty) |
| 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. | |
| 4 | |
| 5 #ifndef UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_CONTROLLER_H_ | |
| 6 #define UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_CONTROLLER_H_ | |
| 7 | |
| 8 #include <memory> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 #include "base/time/time.h" | |
| 12 #include "ui/compositor/layer_tree_owner.h" | |
| 13 #include "ui/events/event_handler.h" | |
| 14 #include "ui/gfx/geometry/rect.h" | |
| 15 #include "ui/gfx/geometry/size.h" | |
| 16 #include "ui/views/animation/ink_drop_state.h" | |
| 17 #include "ui/views/views_export.h" | |
| 18 | |
| 19 namespace ui { | |
| 20 class Layer; | |
| 21 } | |
| 22 | |
| 23 namespace views { | |
| 24 | |
| 25 // Pure virtual base class that manages the lifetime and state of an ink drop | |
| 26 // ripple as well as visual hover state feedback. | |
| 27 class VIEWS_EXPORT InkDropAnimationController { | |
| 28 public: | |
| 29 virtual ~InkDropAnimationController() {} | |
| 30 | |
| 31 // Gets the target state of the ink drop. | |
| 32 virtual InkDropState GetTargetInkDropState() const = 0; | |
| 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|. | |
| 39 virtual void AnimateToState(InkDropState ink_drop_state) = 0; | |
| 40 | |
| 41 // Immediately snaps the InkDropState to ACTIVATED. This more specific | |
| 42 // implementation of the non-existent SnapToState(InkDropState) function is | |
| 43 // the only one available because it was the only InkDropState that clients | |
| 44 // needed to skip animations for. | |
| 45 virtual void SnapToActivated() = 0; | |
| 46 | |
| 47 // Enables or disables the hover state. | |
| 48 virtual void SetHovered(bool is_hovered) = 0; | |
| 49 | |
| 50 protected: | |
| 51 InkDropAnimationController() {} | |
| 52 | |
| 53 private: | |
| 54 DISALLOW_COPY_AND_ASSIGN(InkDropAnimationController); | |
| 55 }; | |
| 56 | |
| 57 } // namespace views | |
| 58 | |
| 59 #endif // UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_CONTROLLER_H_ | |
| OLD | NEW |