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

Side by Side Diff: ui/views/animation/ink_drop_hover.cc

Issue 1915983009: Fixed material design ink drop location for the MD download shelf buttons. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 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 #include "ui/views/animation/ink_drop_hover.h" 5 #include "ui/views/animation/ink_drop_hover.h"
6 6
7 #include "third_party/skia/include/core/SkColor.h" 7 #include "third_party/skia/include/core/SkColor.h"
8 #include "ui/compositor/callback_layer_animation_observer.h" 8 #include "ui/compositor/callback_layer_animation_observer.h"
9 #include "ui/compositor/layer.h" 9 #include "ui/compositor/layer.h"
10 #include "ui/compositor/layer_animation_sequence.h" 10 #include "ui/compositor/layer_animation_sequence.h"
11 #include "ui/compositor/scoped_layer_animation_settings.h" 11 #include "ui/compositor/scoped_layer_animation_settings.h"
12 #include "ui/views/animation/ink_drop_painted_layer_delegates.h" 12 #include "ui/views/animation/ink_drop_painted_layer_delegates.h"
13 13
14 namespace views { 14 namespace views {
15 15
16 namespace { 16 namespace {
17 17
18 // The opacity of the hover when it is visible. 18 // The opacity of the hover when it is visible.
19 const float kHoverVisibleOpacity = 0.128f; 19 const float kHoverVisibleOpacity = 0.128f;
20 20
21 // The opacity of the hover when it is not visible. 21 // The opacity of the hover when it is not visible.
22 const float kHiddenOpacity = 0.0f; 22 const float kHiddenOpacity = 0.0f;
23 23
24 } // namespace 24 } // namespace
25 25
26 InkDropHover::InkDropHover(const gfx::Rect& bounds,
27 int corner_radius,
28 SkColor color)
29 : InkDropHover(bounds.size(), corner_radius, bounds.CenterPoint(), color) {}
30
26 InkDropHover::InkDropHover(const gfx::Size& size, 31 InkDropHover::InkDropHover(const gfx::Size& size,
27 int corner_radius, 32 int corner_radius,
28 const gfx::Point& center_point, 33 const gfx::Point& center_point,
29 SkColor color) 34 SkColor color)
30 : size_(size), 35 : size_(size),
31 explode_size_(size), 36 explode_size_(size),
32 center_point_(center_point), 37 center_point_(center_point),
33 last_animation_initiated_was_fade_in_(false), 38 last_animation_initiated_was_fade_in_(false),
34 layer_delegate_( 39 layer_delegate_(
35 new RoundedRectangleLayerDelegate(color, size, corner_radius)), 40 new RoundedRectangleLayerDelegate(color, size, corner_radius)),
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 HoverAnimationType animation_type, 120 HoverAnimationType animation_type,
116 const ui::CallbackLayerAnimationObserver& observer) { 121 const ui::CallbackLayerAnimationObserver& observer) {
117 // AnimationEndedCallback() may be invoked when this is being destroyed and 122 // AnimationEndedCallback() may be invoked when this is being destroyed and
118 // |layer_| may be null. 123 // |layer_| may be null.
119 if (animation_type == FADE_OUT && layer_) 124 if (animation_type == FADE_OUT && layer_)
120 layer_->SetVisible(false); 125 layer_->SetVisible(false);
121 return true; 126 return true;
122 } 127 }
123 128
124 } // namespace views 129 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698