| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 new ui::CallbackLayerAnimationObserver( | 77 new ui::CallbackLayerAnimationObserver( |
| 78 base::Bind(&InkDropRipple::AnimationStartedCallback, | 78 base::Bind(&InkDropRipple::AnimationStartedCallback, |
| 79 base::Unretained(this), InkDropState::ACTIVATED), | 79 base::Unretained(this), InkDropState::ACTIVATED), |
| 80 base::Bind(&InkDropRipple::AnimationEndedCallback, | 80 base::Bind(&InkDropRipple::AnimationEndedCallback, |
| 81 base::Unretained(this), InkDropState::ACTIVATED)); | 81 base::Unretained(this), InkDropState::ACTIVATED)); |
| 82 GetRootLayer()->SetVisible(true); | 82 GetRootLayer()->SetVisible(true); |
| 83 target_ink_drop_state_ = InkDropState::ACTIVATED; | 83 target_ink_drop_state_ = InkDropState::ACTIVATED; |
| 84 animation_observer->SetActive(); | 84 animation_observer->SetActive(); |
| 85 } | 85 } |
| 86 | 86 |
| 87 bool InkDropRipple::IsVisible() { |
| 88 return GetRootLayer()->visible(); |
| 89 } |
| 90 |
| 87 void InkDropRipple::HideImmediately() { | 91 void InkDropRipple::HideImmediately() { |
| 88 AbortAllAnimations(); | 92 AbortAllAnimations(); |
| 89 SetStateToHidden(); | 93 SetStateToHidden(); |
| 90 target_ink_drop_state_ = InkDropState::HIDDEN; | 94 target_ink_drop_state_ = InkDropState::HIDDEN; |
| 91 } | 95 } |
| 92 | 96 |
| 93 test::InkDropRippleTestApi* InkDropRipple::GetTestApi() { | 97 test::InkDropRippleTestApi* InkDropRipple::GetTestApi() { |
| 94 return nullptr; | 98 return nullptr; |
| 95 } | 99 } |
| 96 | 100 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 107 SetStateToHidden(); | 111 SetStateToHidden(); |
| 108 observer_->AnimationEnded(ink_drop_state, | 112 observer_->AnimationEnded(ink_drop_state, |
| 109 observer.aborted_count() | 113 observer.aborted_count() |
| 110 ? InkDropAnimationEndedReason::PRE_EMPTED | 114 ? InkDropAnimationEndedReason::PRE_EMPTED |
| 111 : InkDropAnimationEndedReason::SUCCESS); | 115 : InkDropAnimationEndedReason::SUCCESS); |
| 112 // |this| may be deleted! | 116 // |this| may be deleted! |
| 113 return true; | 117 return true; |
| 114 } | 118 } |
| 115 | 119 |
| 116 } // namespace views | 120 } // namespace views |
| OLD | NEW |