| 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_IMPL_H_ | 5 #ifndef UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_CONTROLLER_IMPL_H_ |
| 6 #define UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_CONTROLLER_IMPL_H_ | 6 #define UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_CONTROLLER_IMPL_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 "ui/gfx/geometry/rect.h" | 10 #include "ui/gfx/geometry/rect.h" |
| 11 #include "ui/gfx/geometry/size.h" | 11 #include "ui/gfx/geometry/size.h" |
| 12 #include "ui/views/animation/ink_drop_animation_controller.h" | 12 #include "ui/views/animation/ink_drop_animation_controller.h" |
| 13 #include "ui/views/animation/ink_drop_animation_observer.h" | 13 #include "ui/views/animation/ink_drop_animation_observer.h" |
| 14 #include "ui/views/views_export.h" | 14 #include "ui/views/views_export.h" |
| 15 | 15 |
| 16 namespace base { | 16 namespace base { |
| 17 class Timer; | 17 class Timer; |
| 18 } // namespace base | 18 } // namespace base |
| 19 | 19 |
| 20 namespace views { | 20 namespace views { |
| 21 namespace test { |
| 22 class InkDropAnimationControllerImplTestApi; |
| 23 } // namespace test |
| 24 |
| 21 class InkDropAnimation; | 25 class InkDropAnimation; |
| 22 class InkDropHost; | 26 class InkDropHost; |
| 23 class InkDropHover; | 27 class InkDropHover; |
| 24 class InkDropAnimationControllerFactoryTest; | 28 class InkDropAnimationControllerFactoryTest; |
| 25 | 29 |
| 26 // A functional implementation of an InkDropAnimationController. | 30 // A functional implementation of an InkDropAnimationController. |
| 27 class VIEWS_EXPORT InkDropAnimationControllerImpl | 31 class VIEWS_EXPORT InkDropAnimationControllerImpl |
| 28 : public InkDropAnimationController, | 32 : public InkDropAnimationController, |
| 29 public InkDropAnimationObserver { | 33 public InkDropAnimationObserver { |
| 30 public: | 34 public: |
| 31 // Constructs an ink drop controller that will attach the ink drop to the | 35 // Constructs an ink drop controller that will attach the ink drop to the |
| 32 // given |ink_drop_host|. | 36 // given |ink_drop_host|. |
| 33 explicit InkDropAnimationControllerImpl(InkDropHost* ink_drop_host); | 37 explicit InkDropAnimationControllerImpl(InkDropHost* ink_drop_host); |
| 34 ~InkDropAnimationControllerImpl() override; | 38 ~InkDropAnimationControllerImpl() override; |
| 35 | 39 |
| 36 // InkDropAnimationController: | 40 // InkDropAnimationController: |
| 37 InkDropState GetTargetInkDropState() const override; | 41 InkDropState GetTargetInkDropState() const override; |
| 38 bool IsVisible() const override; | 42 bool IsVisible() const override; |
| 39 void AnimateToState(InkDropState ink_drop_state) override; | 43 void AnimateToState(InkDropState ink_drop_state) override; |
| 40 void SnapToActivated() override; | 44 void SnapToActivated() override; |
| 41 void SetHovered(bool is_hovered) override; | 45 void SetHovered(bool is_hovered) override; |
| 42 | 46 |
| 43 private: | 47 private: |
| 44 friend class InkDropAnimationControllerFactoryTest; | 48 friend class test::InkDropAnimationControllerImplTestApi; |
| 45 friend class InkDropAnimationControllerImplTest; | |
| 46 | 49 |
| 47 // Destroys |ink_drop_animation_| if it's targeted to the HIDDEN state. | 50 // Destroys |ink_drop_animation_| if it's targeted to the HIDDEN state. |
| 48 void DestroyHiddenTargetedAnimations(); | 51 void DestroyHiddenTargetedAnimations(); |
| 49 | 52 |
| 50 // Creates a new InkDropAnimation and sets it to |ink_drop_animation_|. If | 53 // Creates a new InkDropAnimation and sets it to |ink_drop_animation_|. If |
| 51 // |ink_drop_animation_| wasn't null then it will be destroyed using | 54 // |ink_drop_animation_| wasn't null then it will be destroyed using |
| 52 // DestroyInkDropAnimation(). | 55 // DestroyInkDropAnimation(). |
| 53 void CreateInkDropAnimation(); | 56 void CreateInkDropAnimation(); |
| 54 | 57 |
| 55 // Destroys the current |ink_drop_animation_|. | 58 // Destroys the current |ink_drop_animation_|. |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 | 114 |
| 112 // The timer used to delay the hover fade in after an ink drop animation. | 115 // The timer used to delay the hover fade in after an ink drop animation. |
| 113 scoped_ptr<base::Timer> hover_after_animation_timer_; | 116 scoped_ptr<base::Timer> hover_after_animation_timer_; |
| 114 | 117 |
| 115 DISALLOW_COPY_AND_ASSIGN(InkDropAnimationControllerImpl); | 118 DISALLOW_COPY_AND_ASSIGN(InkDropAnimationControllerImpl); |
| 116 }; | 119 }; |
| 117 | 120 |
| 118 } // namespace views | 121 } // namespace views |
| 119 | 122 |
| 120 #endif // UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_CONTROLLER_IMPL_H_ | 123 #endif // UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_CONTROLLER_IMPL_H_ |
| OLD | NEW |