| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |