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

Unified Diff: ui/views/animation/square_ink_drop_animation.cc

Issue 1682893002: Color the ink drop ripple and hover effects based on theming. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix unit tests 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 side-by-side diff with in-line comments
Download patch
Index: ui/views/animation/square_ink_drop_animation.cc
diff --git a/ui/views/animation/square_ink_drop_animation.cc b/ui/views/animation/square_ink_drop_animation.cc
index feea8bc328226e2979ec12f105f7dcf2e6ecc798..5930ea94272e31d7323f36a54c114a344c3539ff 100644
--- a/ui/views/animation/square_ink_drop_animation.cc
+++ b/ui/views/animation/square_ink_drop_animation.cc
@@ -31,9 +31,6 @@ const float kMinimumRectScale = 0.0001f;
// were causing visual anomalies.
const float kMinimumCircleScale = 0.001f;
-// The ink drop color.
-const SkColor kInkDropColor = SK_ColorBLACK;
-
// All the sub animations that are used to animate each of the InkDropStates.
// These are used to get time durations with
// GetAnimationDuration(InkDropSubAnimations). Note that in general a sub
@@ -176,7 +173,8 @@ gfx::Transform CalculateRectTransform(const gfx::Point& drawn_center_point,
namespace views {
-SquareInkDropAnimation::SquareInkDropAnimation(const gfx::Size& large_size,
+SquareInkDropAnimation::SquareInkDropAnimation(SkColor color,
+ const gfx::Size& large_size,
int large_corner_radius,
const gfx::Size& small_size,
int small_corner_radius)
@@ -185,10 +183,9 @@ SquareInkDropAnimation::SquareInkDropAnimation(const gfx::Size& large_size,
small_size_(small_size),
small_corner_radius_(small_corner_radius),
circle_layer_delegate_(new CircleLayerDelegate(
- kInkDropColor,
+ color,
std::min(large_size_.width(), large_size_.height()) / 2)),
- rect_layer_delegate_(
- new RectangleLayerDelegate(kInkDropColor, large_size_)) {
+ rect_layer_delegate_(new RectangleLayerDelegate(color, large_size_)) {
for (int i = 0; i < PAINTED_SHAPE_COUNT; ++i)
AddPaintLayer(static_cast<PaintedShape>(i));
@@ -201,6 +198,10 @@ SquareInkDropAnimation::~SquareInkDropAnimation() {
set_destroying();
}
+SkColor SquareInkDropAnimation::GetColor() const {
+ return circle_layer_delegate_->color();
+}
+
void SquareInkDropAnimation::AbortAllAnimations() {
InkDropAnimation::AbortAllAnimations();
for (int i = 0; i < PAINTED_SHAPE_COUNT; ++i)

Powered by Google App Engine
This is Rietveld 408576698