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_HOVER_H_ | 5 #ifndef UI_VIEWS_ANIMATION_INK_DROP_HOVER_H_ |
6 #define UI_VIEWS_ANIMATION_INK_DROP_HOVER_H_ | 6 #define UI_VIEWS_ANIMATION_INK_DROP_HOVER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/time/time.h" | 11 #include "base/time/time.h" |
12 #include "third_party/skia/include/core/SkColor.h" | 12 #include "third_party/skia/include/core/SkColor.h" |
13 #include "ui/gfx/geometry/point.h" | 13 #include "ui/gfx/geometry/point.h" |
14 #include "ui/gfx/geometry/point_f.h" | 14 #include "ui/gfx/geometry/point_f.h" |
| 15 #include "ui/gfx/geometry/rect.h" |
15 #include "ui/gfx/geometry/size.h" | 16 #include "ui/gfx/geometry/size.h" |
16 #include "ui/gfx/transform.h" | 17 #include "ui/gfx/transform.h" |
17 #include "ui/views/views_export.h" | 18 #include "ui/views/views_export.h" |
18 | 19 |
19 namespace ui { | 20 namespace ui { |
20 class Layer; | 21 class Layer; |
21 class CallbackLayerAnimationObserver; | 22 class CallbackLayerAnimationObserver; |
22 } // namespace ui | 23 } // namespace ui |
23 | 24 |
24 namespace views { | 25 namespace views { |
25 class RoundedRectangleLayerDelegate; | 26 class RoundedRectangleLayerDelegate; |
26 | 27 |
27 // Manages fade in/out animations for a painted Layer that is used to provide | 28 // Manages fade in/out animations for a painted Layer that is used to provide |
28 // visual feedback on ui::Views for mouse hover states. | 29 // visual feedback on ui::Views for mouse hover states. |
29 class VIEWS_EXPORT InkDropHover { | 30 class VIEWS_EXPORT InkDropHover { |
30 public: | 31 public: |
| 32 InkDropHover(const gfx::Rect& bounds, int corner_radius, SkColor color); |
31 InkDropHover(const gfx::Size& size, | 33 InkDropHover(const gfx::Size& size, |
32 int corner_radius, | 34 int corner_radius, |
33 const gfx::Point& center_point, | 35 const gfx::Point& center_point, |
34 SkColor color); | 36 SkColor color); |
35 ~InkDropHover(); | 37 ~InkDropHover(); |
36 | 38 |
37 void set_explode_size(const gfx::Size& size) { explode_size_ = size; } | 39 void set_explode_size(const gfx::Size& size) { explode_size_ = size; } |
38 | 40 |
39 // Returns true if the hover animation is either in the process of fading | 41 // Returns true if the hover animation is either in the process of fading |
40 // in or is fully visible. | 42 // in or is fully visible. |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 | 90 |
89 // The visual hover layer that is painted by |layer_delegate_|. | 91 // The visual hover layer that is painted by |layer_delegate_|. |
90 std::unique_ptr<ui::Layer> layer_; | 92 std::unique_ptr<ui::Layer> layer_; |
91 | 93 |
92 DISALLOW_COPY_AND_ASSIGN(InkDropHover); | 94 DISALLOW_COPY_AND_ASSIGN(InkDropHover); |
93 }; | 95 }; |
94 | 96 |
95 } // namespace views | 97 } // namespace views |
96 | 98 |
97 #endif // UI_VIEWS_ANIMATION_INK_DROP_HOVER_H_ | 99 #endif // UI_VIEWS_ANIMATION_INK_DROP_HOVER_H_ |
OLD | NEW |