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

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

Issue 2615613003: Fix double ripple on activated flood fill ripple (Closed)
Patch Set: Addressed nits Created 3 years, 11 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_ripple.h" 5 #include "ui/views/animation/ink_drop_ripple.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "ui/base/ui_base_switches.h" 10 #include "ui/base/ui_base_switches.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 target_ink_drop_state_ = InkDropState::HIDDEN; 96 target_ink_drop_state_ = InkDropState::HIDDEN;
97 } 97 }
98 98
99 test::InkDropRippleTestApi* InkDropRipple::GetTestApi() { 99 test::InkDropRippleTestApi* InkDropRipple::GetTestApi() {
100 return nullptr; 100 return nullptr;
101 } 101 }
102 102
103 void InkDropRipple::AnimationStartedCallback( 103 void InkDropRipple::AnimationStartedCallback(
104 InkDropState ink_drop_state, 104 InkDropState ink_drop_state,
105 const ui::CallbackLayerAnimationObserver& observer) { 105 const ui::CallbackLayerAnimationObserver& observer) {
106 observer_->AnimationStarted(ink_drop_state); 106 if (observer_)
107 observer_->AnimationStarted(ink_drop_state);
107 } 108 }
108 109
109 bool InkDropRipple::AnimationEndedCallback( 110 bool InkDropRipple::AnimationEndedCallback(
110 InkDropState ink_drop_state, 111 InkDropState ink_drop_state,
111 const ui::CallbackLayerAnimationObserver& observer) { 112 const ui::CallbackLayerAnimationObserver& observer) {
112 if (ink_drop_state == InkDropState::HIDDEN) 113 if (ink_drop_state == InkDropState::HIDDEN)
113 SetStateToHidden(); 114 SetStateToHidden();
114 observer_->AnimationEnded(ink_drop_state, 115 if (observer_)
115 observer.aborted_count() 116 observer_->AnimationEnded(ink_drop_state,
116 ? InkDropAnimationEndedReason::PRE_EMPTED 117 observer.aborted_count()
117 : InkDropAnimationEndedReason::SUCCESS); 118 ? InkDropAnimationEndedReason::PRE_EMPTED
119 : InkDropAnimationEndedReason::SUCCESS);
118 // |this| may be deleted! 120 // |this| may be deleted!
119 return true; 121 return true;
120 } 122 }
121 123
122 } // namespace views 124 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/animation/ink_drop_highlight_unittest.cc ('k') | ui/views/animation/ink_drop_ripple_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698