| 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 12 matching lines...) Expand all Loading... |
| 23 return fast; | 23 return fast; |
| 24 } | 24 } |
| 25 | 25 |
| 26 const float InkDropRipple::kHiddenOpacity = 0.f; | 26 const float InkDropRipple::kHiddenOpacity = 0.f; |
| 27 | 27 |
| 28 InkDropRipple::InkDropRipple() | 28 InkDropRipple::InkDropRipple() |
| 29 : target_ink_drop_state_(InkDropState::HIDDEN), observer_(nullptr) {} | 29 : target_ink_drop_state_(InkDropState::HIDDEN), observer_(nullptr) {} |
| 30 | 30 |
| 31 InkDropRipple::~InkDropRipple() {} | 31 InkDropRipple::~InkDropRipple() {} |
| 32 | 32 |
| 33 void InkDropRipple::HostSizeChanged(const gfx::Size& new_size) {} |
| 34 |
| 33 void InkDropRipple::AnimateToState(InkDropState ink_drop_state) { | 35 void InkDropRipple::AnimateToState(InkDropState ink_drop_state) { |
| 34 // Does not return early if |target_ink_drop_state_| == |ink_drop_state| for | 36 // Does not return early if |target_ink_drop_state_| == |ink_drop_state| for |
| 35 // two reasons. | 37 // two reasons. |
| 36 // 1. The attached observers must be notified of all animations started and | 38 // 1. The attached observers must be notified of all animations started and |
| 37 // ended. | 39 // ended. |
| 38 // 2. Not all state transitions is are valid, especially no-op transitions, | 40 // 2. Not all state transitions is are valid, especially no-op transitions, |
| 39 // and these should be detected by DCHECKs in AnimateStateChange(). | 41 // and these should be detected by DCHECKs in AnimateStateChange(). |
| 40 | 42 |
| 41 // |animation_observer| will be deleted when AnimationEndedCallback() returns | 43 // |animation_observer| will be deleted when AnimationEndedCallback() returns |
| 42 // true. | 44 // true. |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 SetStateToHidden(); | 113 SetStateToHidden(); |
| 112 observer_->AnimationEnded(ink_drop_state, | 114 observer_->AnimationEnded(ink_drop_state, |
| 113 observer.aborted_count() | 115 observer.aborted_count() |
| 114 ? InkDropAnimationEndedReason::PRE_EMPTED | 116 ? InkDropAnimationEndedReason::PRE_EMPTED |
| 115 : InkDropAnimationEndedReason::SUCCESS); | 117 : InkDropAnimationEndedReason::SUCCESS); |
| 116 // |this| may be deleted! | 118 // |this| may be deleted! |
| 117 return true; | 119 return true; |
| 118 } | 120 } |
| 119 | 121 |
| 120 } // namespace views | 122 } // namespace views |
| OLD | NEW |