Chromium Code Reviews| 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_impl.h" | 5 #include "ui/views/animation/ink_drop_impl.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/timer/timer.h" | 8 #include "base/timer/timer.h" |
| 9 #include "ui/compositor/layer.h" | 9 #include "ui/compositor/layer.h" |
| 10 #include "ui/views/animation/ink_drop_highlight.h" | 10 #include "ui/views/animation/ink_drop_highlight.h" |
| (...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 700 | 700 |
| 701 void InkDropImpl::AnimationStarted(InkDropState ink_drop_state) { | 701 void InkDropImpl::AnimationStarted(InkDropState ink_drop_state) { |
| 702 highlight_state_->AnimationStarted(ink_drop_state); | 702 highlight_state_->AnimationStarted(ink_drop_state); |
| 703 } | 703 } |
| 704 | 704 |
| 705 void InkDropImpl::AnimationEnded(InkDropState ink_drop_state, | 705 void InkDropImpl::AnimationEnded(InkDropState ink_drop_state, |
| 706 InkDropAnimationEndedReason reason) { | 706 InkDropAnimationEndedReason reason) { |
| 707 highlight_state_->AnimationEnded(ink_drop_state, reason); | 707 highlight_state_->AnimationEnded(ink_drop_state, reason); |
| 708 if (reason != InkDropAnimationEndedReason::SUCCESS) | 708 if (reason != InkDropAnimationEndedReason::SUCCESS) |
| 709 return; | 709 return; |
| 710 // |ink_drop_ripple_| might be null during destruction. | |
| 711 if (!ink_drop_ripple_) | |
|
bruthig
2016/11/11 17:30:40
Can you add an InkDropImpl specific test for this?
mohsen
2016/11/11 22:37:24
Done.
| |
| 712 return; | |
| 710 if (ShouldAnimateToHidden(ink_drop_state)) { | 713 if (ShouldAnimateToHidden(ink_drop_state)) { |
| 711 ink_drop_ripple_->AnimateToState(views::InkDropState::HIDDEN); | 714 ink_drop_ripple_->AnimateToState(views::InkDropState::HIDDEN); |
| 712 } else if (ink_drop_state == views::InkDropState::HIDDEN) { | 715 } else if (ink_drop_state == views::InkDropState::HIDDEN) { |
| 713 // TODO(bruthig): Investigate whether creating and destroying | 716 // TODO(bruthig): Investigate whether creating and destroying |
| 714 // InkDropRipples is expensive and consider creating an | 717 // InkDropRipples is expensive and consider creating an |
| 715 // InkDropRipplePool. See www.crbug.com/522175. | 718 // InkDropRipplePool. See www.crbug.com/522175. |
| 716 DestroyInkDropRipple(); | 719 DestroyInkDropRipple(); |
| 717 } | 720 } |
| 718 } | 721 } |
| 719 | 722 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 769 "within a call to " | 772 "within a call to " |
| 770 "HighlightState::Exit()."; | 773 "HighlightState::Exit()."; |
| 771 if (highlight_state_) { | 774 if (highlight_state_) { |
| 772 base::AutoReset<bool> exit_guard(&exiting_highlight_state_, true); | 775 base::AutoReset<bool> exit_guard(&exiting_highlight_state_, true); |
| 773 highlight_state_->Exit(); | 776 highlight_state_->Exit(); |
| 774 } | 777 } |
| 775 highlight_state_ = nullptr; | 778 highlight_state_ = nullptr; |
| 776 } | 779 } |
| 777 | 780 |
| 778 } // namespace views | 781 } // namespace views |
| OLD | NEW |