| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/compositor/layer_animator.h" | 5 #include "ui/compositor/layer_animator.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 | 189 |
| 190 timeline->DetachPlayer(animation_player_); | 190 timeline->DetachPlayer(animation_player_); |
| 191 } | 191 } |
| 192 | 192 |
| 193 void LayerAnimator::AttachLayerToAnimationPlayer(int layer_id) { | 193 void LayerAnimator::AttachLayerToAnimationPlayer(int layer_id) { |
| 194 if (!animation_player_->layer_id()) | 194 if (!animation_player_->layer_id()) |
| 195 animation_player_->AttachLayer(layer_id); | 195 animation_player_->AttachLayer(layer_id); |
| 196 else | 196 else |
| 197 DCHECK_EQ(animation_player_->layer_id(), layer_id); | 197 DCHECK_EQ(animation_player_->layer_id(), layer_id); |
| 198 | 198 |
| 199 if (animation_player_->element_animations()) { | 199 if (animation_player_->element_animations()) |
| 200 animation_player_->element_animations() | 200 animation_player_->element_animations()->SetEventObserver(this); |
| 201 ->AddEventObserver(this); | |
| 202 } | |
| 203 } | 201 } |
| 204 | 202 |
| 205 void LayerAnimator::DetachLayerFromAnimationPlayer() { | 203 void LayerAnimator::DetachLayerFromAnimationPlayer() { |
| 206 if (animation_player_->element_animations()) { | 204 if (animation_player_->element_animations()) |
| 207 animation_player_->element_animations() | 205 animation_player_->element_animations()->SetEventObserver(nullptr); |
| 208 ->RemoveEventObserver(this); | |
| 209 } | |
| 210 | 206 |
| 211 if (animation_player_->layer_id()) | 207 if (animation_player_->layer_id()) |
| 212 animation_player_->DetachLayer(); | 208 animation_player_->DetachLayer(); |
| 213 } | 209 } |
| 214 | 210 |
| 215 void LayerAnimator::AddThreadedAnimation( | 211 void LayerAnimator::AddThreadedAnimation( |
| 216 std::unique_ptr<cc::Animation> animation) { | 212 std::unique_ptr<cc::Animation> animation) { |
| 217 animation_player_->AddAnimation(std::move(animation)); | 213 animation_player_->AddAnimation(std::move(animation)); |
| 218 } | 214 } |
| 219 | 215 |
| (...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 964 const base::WeakPtr<LayerAnimationSequence>& sequence) | 960 const base::WeakPtr<LayerAnimationSequence>& sequence) |
| 965 : sequence_(sequence) { | 961 : sequence_(sequence) { |
| 966 } | 962 } |
| 967 | 963 |
| 968 LayerAnimator::RunningAnimation::RunningAnimation( | 964 LayerAnimator::RunningAnimation::RunningAnimation( |
| 969 const RunningAnimation& other) = default; | 965 const RunningAnimation& other) = default; |
| 970 | 966 |
| 971 LayerAnimator::RunningAnimation::~RunningAnimation() { } | 967 LayerAnimator::RunningAnimation::~RunningAnimation() { } |
| 972 | 968 |
| 973 } // namespace ui | 969 } // namespace ui |
| OLD | NEW |