| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_SQUARE_INK_DROP_ANIMATION_H_ | 5 #ifndef UI_VIEWS_ANIMATION_SQUARE_INK_DROP_ANIMATION_H_ |
| 6 #define UI_VIEWS_ANIMATION_SQUARE_INK_DROP_ANIMATION_H_ | 6 #define UI_VIEWS_ANIMATION_SQUARE_INK_DROP_ANIMATION_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
| 13 #include "ui/compositor/layer.h" | 13 #include "ui/compositor/layer.h" |
| 14 #include "ui/compositor/layer_animator.h" | 14 #include "ui/compositor/layer_animator.h" |
| 15 #include "ui/gfx/animation/tween.h" | 15 #include "ui/gfx/animation/tween.h" |
| 16 #include "ui/gfx/geometry/size.h" | 16 #include "ui/gfx/geometry/size.h" |
| 17 #include "ui/gfx/transform.h" | 17 #include "ui/gfx/transform.h" |
| 18 #include "ui/views/animation/ink_drop_animation.h" | 18 #include "ui/views/animation/ink_drop_animation.h" |
| 19 #include "ui/views/animation/ink_drop_state.h" | 19 #include "ui/views/animation/ink_drop_state.h" |
| 20 #include "ui/views/views_export.h" | 20 #include "ui/views/views_export.h" |
| 21 | 21 |
| 22 namespace gfx { |
| 23 class Point; |
| 24 } // namespace gfx |
| 25 |
| 22 namespace ui { | 26 namespace ui { |
| 23 class CallbackLayerAnimationObserver; | 27 class CallbackLayerAnimationObserver; |
| 24 class Layer; | 28 class Layer; |
| 25 class LayerAnimationObserver; | 29 class LayerAnimationObserver; |
| 26 } // namespace ui | 30 } // namespace ui |
| 27 | 31 |
| 28 namespace views { | 32 namespace views { |
| 29 class CircleLayerDelegate; | 33 class CircleLayerDelegate; |
| 30 class RectangleLayerDelegate; | 34 class RectangleLayerDelegate; |
| 31 | 35 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 46 // ACTION_PENDING => SLOW_ACTION_PENDING | 50 // ACTION_PENDING => SLOW_ACTION_PENDING |
| 47 // SLOW_ACTION_PENDING => SLOW_ACTION | 51 // SLOW_ACTION_PENDING => SLOW_ACTION |
| 48 // {All InkDropStates} => ACTIVATED | 52 // {All InkDropStates} => ACTIVATED |
| 49 // {All InkDropStates} => DEACTIVATED | 53 // {All InkDropStates} => DEACTIVATED |
| 50 // | 54 // |
| 51 class VIEWS_EXPORT SquareInkDropAnimation : public InkDropAnimation { | 55 class VIEWS_EXPORT SquareInkDropAnimation : public InkDropAnimation { |
| 52 public: | 56 public: |
| 53 SquareInkDropAnimation(const gfx::Size& large_size, | 57 SquareInkDropAnimation(const gfx::Size& large_size, |
| 54 int large_corner_radius, | 58 int large_corner_radius, |
| 55 const gfx::Size& small_size, | 59 const gfx::Size& small_size, |
| 56 int small_corner_radius); | 60 int small_corner_radius, |
| 61 const gfx::Point& center_point, |
| 62 SkColor color); |
| 57 ~SquareInkDropAnimation() override; | 63 ~SquareInkDropAnimation() override; |
| 58 | 64 |
| 59 // InkDropAnimation: | 65 // InkDropAnimation: |
| 60 ui::Layer* GetRootLayer() override; | 66 ui::Layer* GetRootLayer() override; |
| 61 InkDropState GetTargetInkDropState() const override; | 67 InkDropState GetTargetInkDropState() const override; |
| 62 bool IsVisible() const override; | 68 bool IsVisible() const override; |
| 63 void AnimateToState(InkDropState ink_drop_state) override; | 69 void AnimateToState(InkDropState ink_drop_state) override; |
| 64 void SetCenterPoint(const gfx::Point& center_point) override; | |
| 65 void HideImmediately() override; | 70 void HideImmediately() override; |
| 66 | 71 |
| 67 private: | 72 private: |
| 68 friend class test::SquareInkDropAnimationTestApi; | 73 friend class test::SquareInkDropAnimationTestApi; |
| 69 | 74 |
| 70 // Enumeration of the different shapes that compose the ink drop. | 75 // Enumeration of the different shapes that compose the ink drop. |
| 71 enum PaintedShape { | 76 enum PaintedShape { |
| 72 TOP_LEFT_CIRCLE = 0, | 77 TOP_LEFT_CIRCLE = 0, |
| 73 TOP_RIGHT_CIRCLE, | 78 TOP_RIGHT_CIRCLE, |
| 74 BOTTOM_RIGHT_CIRCLE, | 79 BOTTOM_RIGHT_CIRCLE, |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 | 199 |
| 195 // The current ink drop state. | 200 // The current ink drop state. |
| 196 InkDropState ink_drop_state_; | 201 InkDropState ink_drop_state_; |
| 197 | 202 |
| 198 DISALLOW_COPY_AND_ASSIGN(SquareInkDropAnimation); | 203 DISALLOW_COPY_AND_ASSIGN(SquareInkDropAnimation); |
| 199 }; | 204 }; |
| 200 | 205 |
| 201 } // namespace views | 206 } // namespace views |
| 202 | 207 |
| 203 #endif // UI_VIEWS_ANIMATION_SQUARE_INK_DROP_ANIMATION_H_ | 208 #endif // UI_VIEWS_ANIMATION_SQUARE_INK_DROP_ANIMATION_H_ |
| OLD | NEW |