Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Side by Side Diff: ui/views/animation/square_ink_drop_animation.h

Issue 1724963002: Color the ink drop ripple and hover effects based on theming. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sky review Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « ui/views/animation/ink_drop_hover_unittest.cc ('k') | ui/views/animation/square_ink_drop_animation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698