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

Side by Side Diff: cc/animation_registrar.cc

Issue 12822004: Part 3 of cc/ directory shuffles: animation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « cc/animation_registrar.h ('k') | cc/animation_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "cc/animation_registrar.h"
6
7 #include "cc/layer_animation_controller.h"
8
9 namespace cc {
10
11 AnimationRegistrar::AnimationRegistrar() { }
12 AnimationRegistrar::~AnimationRegistrar()
13 {
14 AnimationControllerMap copy = all_animation_controllers_;
15 for (AnimationControllerMap::iterator iter = copy.begin(); iter != copy.end( ); ++iter)
16 (*iter).second->SetAnimationRegistrar(NULL);
17 }
18
19 scoped_refptr<LayerAnimationController>
20 AnimationRegistrar::GetAnimationControllerForId(int id)
21 {
22 scoped_refptr<LayerAnimationController> toReturn;
23 if (!ContainsKey(all_animation_controllers_, id)) {
24 toReturn = LayerAnimationController::Create(id);
25 toReturn->SetAnimationRegistrar(this);
26 all_animation_controllers_[id] = toReturn.get();
27 } else
28 toReturn = all_animation_controllers_[id];
29 return toReturn;
30 }
31
32 void AnimationRegistrar::DidActivateAnimationController(LayerAnimationController * controller) {
33 active_animation_controllers_[controller->id()] = controller;
34 }
35
36 void AnimationRegistrar::DidDeactivateAnimationController(LayerAnimationControll er* controller) {
37 if (ContainsKey(active_animation_controllers_, controller->id()))
38 active_animation_controllers_.erase(controller->id());
39 }
40
41 void AnimationRegistrar::RegisterAnimationController(LayerAnimationController* c ontroller) {
42 all_animation_controllers_[controller->id()] = controller;
43 }
44
45 void AnimationRegistrar::UnregisterAnimationController(LayerAnimationController* controller) {
46 if (ContainsKey(all_animation_controllers_, controller->id()))
47 all_animation_controllers_.erase(controller->id());
48 DidDeactivateAnimationController(controller);
49 }
50
51 } // namespace cc
OLDNEW
« no previous file with comments | « cc/animation_registrar.h ('k') | cc/animation_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698