| 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/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "ui/compositor/layer_tree_owner.h" | 10 #include "ui/compositor/layer_tree_owner.h" |
| 11 #include "ui/events/event_handler.h" | 11 #include "ui/events/event_handler.h" |
| 12 #include "ui/gfx/geometry/rect.h" | 12 #include "ui/gfx/geometry/rect.h" |
| 13 #include "ui/gfx/geometry/size.h" | 13 #include "ui/gfx/geometry/size.h" |
| 14 #include "ui/views/animation/ink_drop_state.h" |
| 14 #include "ui/views/views_export.h" | 15 #include "ui/views/views_export.h" |
| 15 | 16 |
| 16 namespace ui { | 17 namespace ui { |
| 17 class Layer; | 18 class Layer; |
| 18 } | 19 } |
| 19 | 20 |
| 20 namespace views { | 21 namespace views { |
| 21 class AppearAnimationObserver; | 22 class AppearAnimationObserver; |
| 22 class InkDropDelegate; | 23 class InkDropDelegate; |
| 23 class InkDropHost; | 24 class InkDropHost; |
| 24 class View; | 25 class View; |
| 25 | 26 |
| 26 // The different states that the ink drop animation can be animated to. | |
| 27 enum class InkDropState { | |
| 28 // The ink drop is not visible. | |
| 29 HIDDEN, | |
| 30 // The view is being interacted with but the action to be triggered has not | |
| 31 // yet been determined. | |
| 32 ACTION_PENDING, | |
| 33 // The quick action for the view has been triggered. e.g. A tap gesture to | |
| 34 // click a button. | |
| 35 QUICK_ACTION, | |
| 36 // The slow action for the view has been triggered. e.g. A long press to bring | |
| 37 // up a menu. | |
| 38 SLOW_ACTION, | |
| 39 // An active state for a view that is no longer being interacted with. e.g. A | |
| 40 // pressed button that is showing a menu. | |
| 41 ACTIVATED | |
| 42 }; | |
| 43 | |
| 44 // Base class for an ink drop animation which is hosted by an InkDropHost. | 27 // Base class for an ink drop animation which is hosted by an InkDropHost. |
| 45 class VIEWS_EXPORT InkDropAnimationController { | 28 class VIEWS_EXPORT InkDropAnimationController { |
| 46 public: | 29 public: |
| 47 InkDropAnimationController() {} | 30 InkDropAnimationController() {} |
| 48 virtual ~InkDropAnimationController() {} | 31 virtual ~InkDropAnimationController() {} |
| 49 | 32 |
| 50 // Animates from the current InkDropState to |state|. | 33 // Animates from the current InkDropState to |state|. |
| 51 virtual void AnimateToState(InkDropState state) = 0; | 34 virtual void AnimateToState(InkDropState state) = 0; |
| 52 | 35 |
| 53 // Sets the size of the ink drop. | 36 // Sets the size of the ink drop. |
| 54 virtual void SetInkDropSize(const gfx::Size& size) = 0; | 37 virtual void SetInkDropSize(const gfx::Size& size) = 0; |
| 55 | 38 |
| 56 // Returns the ink drop bounds. | 39 // Returns the ink drop bounds. |
| 57 virtual gfx::Rect GetInkDropBounds() const = 0; | 40 virtual gfx::Rect GetInkDropBounds() const = 0; |
| 58 | 41 |
| 59 // Sets the bounds for the ink drop. |bounds| are in the coordinate space of | 42 // Sets the bounds for the ink drop. |bounds| are in the coordinate space of |
| 60 // the parent ui::Layer that the ink drop layer is added to. | 43 // the parent ui::Layer that the ink drop layer is added to. |
| 61 virtual void SetInkDropBounds(const gfx::Rect& bounds) = 0; | 44 virtual void SetInkDropBounds(const gfx::Rect& bounds) = 0; |
| 62 | 45 |
| 63 private: | 46 private: |
| 64 DISALLOW_COPY_AND_ASSIGN(InkDropAnimationController); | 47 DISALLOW_COPY_AND_ASSIGN(InkDropAnimationController); |
| 65 }; | 48 }; |
| 66 | 49 |
| 67 } // namespace views | 50 } // namespace views |
| 68 | 51 |
| 69 #endif // UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_CONTROLLER_H_ | 52 #endif // UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_CONTROLLER_H_ |
| OLD | NEW |