Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(315)

Unified Diff: ui/compositor/layer_animator.cc

Issue 1893253002: CC Animation: Make LayerAnimationController to have just one event observer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@rc
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/animation/layer_animation_controller_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/layer_animator.cc
diff --git a/ui/compositor/layer_animator.cc b/ui/compositor/layer_animator.cc
index 787b12157ef002f4df3ab7345f2a7f177b6c117a..113e4d0ae85adc8f9d922f9a659024779fddd024 100644
--- a/ui/compositor/layer_animator.cc
+++ b/ui/compositor/layer_animator.cc
@@ -196,17 +196,13 @@ void LayerAnimator::AttachLayerToAnimationPlayer(int layer_id) {
else
DCHECK_EQ(animation_player_->layer_id(), layer_id);
- if (animation_player_->element_animations()) {
- animation_player_->element_animations()
- ->AddEventObserver(this);
- }
+ if (animation_player_->element_animations())
+ animation_player_->element_animations()->SetEventObserver(this);
}
void LayerAnimator::DetachLayerFromAnimationPlayer() {
- if (animation_player_->element_animations()) {
- animation_player_->element_animations()
- ->RemoveEventObserver(this);
- }
+ if (animation_player_->element_animations())
+ animation_player_->element_animations()->SetEventObserver(nullptr);
if (animation_player_->layer_id())
animation_player_->DetachLayer();
« no previous file with comments | « cc/animation/layer_animation_controller_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698