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

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

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: self review and format 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 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_animation.h" 5 #include "ui/views/animation/ink_drop_animation.h"
6 6
7 namespace views { 7 namespace views {
8 8
9 const float InkDropAnimation::kHiddenOpacity = 0.f; 9 const float InkDropAnimation::kHiddenOpacity = 0.f;
10 const float InkDropAnimation::kVisibleOpacity = 0.11f; 10 const float InkDropAnimation::kVisibleOpacity = 0.175f;
11 11
12 InkDropAnimation::InkDropAnimation() {} 12 InkDropAnimation::InkDropAnimation() : observer_(nullptr) {}
13 13
14 InkDropAnimation::~InkDropAnimation() {} 14 InkDropAnimation::~InkDropAnimation() {}
15 15
16 void InkDropAnimation::AddObserver(InkDropAnimationObserver* observer) {
17 observers_.AddObserver(observer);
18 }
19
20 void InkDropAnimation::RemoveObserver(InkDropAnimationObserver* observer) {
21 observers_.RemoveObserver(observer);
22 }
23
24 void InkDropAnimation::NotifyAnimationStarted(InkDropState ink_drop_state) { 16 void InkDropAnimation::NotifyAnimationStarted(InkDropState ink_drop_state) {
25 FOR_EACH_OBSERVER(InkDropAnimationObserver, observers_, 17 observer_->InkDropAnimationStarted(ink_drop_state);
bruthig 2016/02/23 22:48:09 Why not guard this with "if (observer_)" ? Similar
Evan Stade 2016/02/24 00:31:57 Because I decided it was an error to not set the o
bruthig 2016/02/24 15:46:55 Acknowledged.
26 InkDropAnimationStarted(ink_drop_state));
27 } 18 }
28 19
29 void InkDropAnimation::NotifyAnimationEnded( 20 void InkDropAnimation::NotifyAnimationEnded(
30 InkDropState ink_drop_state, 21 InkDropState ink_drop_state,
31 InkDropAnimationObserver::InkDropAnimationEndedReason reason) { 22 InkDropAnimationObserver::InkDropAnimationEndedReason reason) {
32 FOR_EACH_OBSERVER(InkDropAnimationObserver, observers_, 23 observer_->InkDropAnimationEnded(ink_drop_state, reason);
33 InkDropAnimationEnded(ink_drop_state, reason)); 24 // |this| may be deleted!
34 } 25 }
35 26
36 } // namespace views 27 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698