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

Side by Side Diff: cc/animation/animation_host.cc

Issue 1912023003: CC Animation: Remove Observers and Observations in namings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@observertype
Patch Set: Rename it in .cc comments as well 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 unified diff | Download patch
« no previous file with comments | « cc/animation/animation.cc ('k') | cc/animation/element_animations.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "cc/animation/animation_host.h" 5 #include "cc/animation/animation_host.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 scoped_refptr<ElementAnimations> element_animations = 223 scoped_refptr<ElementAnimations> element_animations =
224 GetElementAnimationsForLayerId(layer_id); 224 GetElementAnimationsForLayerId(layer_id);
225 if (!element_animations) { 225 if (!element_animations) {
226 element_animations = ElementAnimations::Create(); 226 element_animations = ElementAnimations::Create();
227 element_animations->SetLayerId(layer_id); 227 element_animations->SetLayerId(layer_id);
228 RegisterElementAnimations(element_animations.get()); 228 RegisterElementAnimations(element_animations.get());
229 } 229 }
230 230
231 if (element_animations->animation_host() != this) { 231 if (element_animations->animation_host() != this) {
232 element_animations->SetAnimationHost(this); 232 element_animations->SetAnimationHost(this);
233 element_animations->InitValueObservations(); 233 element_animations->InitAffectedElementTypes();
234 } 234 }
235 235
236 element_animations->AddPlayer(player); 236 element_animations->AddPlayer(player);
237 } 237 }
238 238
239 void AnimationHost::UnregisterPlayerForLayer(int layer_id, 239 void AnimationHost::UnregisterPlayerForLayer(int layer_id,
240 AnimationPlayer* player) { 240 AnimationPlayer* player) {
241 DCHECK(layer_id); 241 DCHECK(layer_id);
242 DCHECK(player); 242 DCHECK(player);
243 243
244 scoped_refptr<ElementAnimations> element_animations = 244 scoped_refptr<ElementAnimations> element_animations =
245 GetElementAnimationsForLayerId(layer_id); 245 GetElementAnimationsForLayerId(layer_id);
246 DCHECK(element_animations); 246 DCHECK(element_animations);
247 element_animations->RemovePlayer(player); 247 element_animations->RemovePlayer(player);
248 248
249 if (element_animations->IsEmpty()) { 249 if (element_animations->IsEmpty()) {
250 element_animations->ClearValueObservations(); 250 element_animations->ClearAffectedElementTypes();
251 UnregisterElementAnimations(element_animations.get()); 251 UnregisterElementAnimations(element_animations.get());
252 element_animations->SetAnimationHost(nullptr); 252 element_animations->SetAnimationHost(nullptr);
253 } 253 }
254 } 254 }
255 255
256 void AnimationHost::SetMutatorHostClient(MutatorHostClient* client) { 256 void AnimationHost::SetMutatorHostClient(MutatorHostClient* client) {
257 if (mutator_host_client_ == client) 257 if (mutator_host_client_ == client)
258 return; 258 return;
259 259
260 mutator_host_client_ = client; 260 mutator_host_client_ = client;
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
691 const AnimationHost::LayerToElementAnimationsMap& 691 const AnimationHost::LayerToElementAnimationsMap&
692 AnimationHost::all_element_animations_for_testing() const { 692 AnimationHost::all_element_animations_for_testing() const {
693 return layer_to_element_animations_map_; 693 return layer_to_element_animations_map_;
694 } 694 }
695 695
696 void AnimationHost::OnAnimationWaitingForDeletion() { 696 void AnimationHost::OnAnimationWaitingForDeletion() {
697 animation_waiting_for_deletion_ = true; 697 animation_waiting_for_deletion_ = true;
698 } 698 }
699 699
700 } // namespace cc 700 } // namespace cc
OLDNEW
« no previous file with comments | « cc/animation/animation.cc ('k') | cc/animation/element_animations.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698