OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef CC_ANIMATION_ANIMATION_REGISTRAR_H_ | 5 #ifndef CC_ANIMATION_ANIMATION_REGISTRAR_H_ |
6 #define CC_ANIMATION_ANIMATION_REGISTRAR_H_ | 6 #define CC_ANIMATION_ANIMATION_REGISTRAR_H_ |
7 | 7 |
8 #include "base/containers/hash_tables.h" | 8 #include <unordered_map> |
| 9 |
9 #include "base/macros.h" | 10 #include "base/macros.h" |
10 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
11 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
12 #include "base/time/time.h" | 13 #include "base/time/time.h" |
13 #include "cc/base/cc_export.h" | 14 #include "cc/base/cc_export.h" |
14 | 15 |
15 namespace cc { | 16 namespace cc { |
16 | 17 |
17 class AnimationEvents; | 18 class AnimationEvents; |
18 class LayerAnimationController; | 19 class LayerAnimationController; |
19 | 20 |
20 class CC_EXPORT AnimationRegistrar { | 21 class CC_EXPORT AnimationRegistrar { |
21 public: | 22 public: |
22 typedef base::hash_map<int, LayerAnimationController*> AnimationControllerMap; | 23 using AnimationControllerMap = |
| 24 std::unordered_map<int, LayerAnimationController*>; |
23 | 25 |
24 static scoped_ptr<AnimationRegistrar> Create() { | 26 static scoped_ptr<AnimationRegistrar> Create() { |
25 return make_scoped_ptr(new AnimationRegistrar()); | 27 return make_scoped_ptr(new AnimationRegistrar()); |
26 } | 28 } |
27 | 29 |
28 virtual ~AnimationRegistrar(); | 30 virtual ~AnimationRegistrar(); |
29 | 31 |
30 // If an animation has been registered for the given id, return it. Otherwise | 32 // If an animation has been registered for the given id, return it. Otherwise |
31 // creates a new one and returns a scoped_refptr to it. | 33 // creates a new one and returns a scoped_refptr to it. |
32 scoped_refptr<LayerAnimationController> GetAnimationControllerForId(int id); | 34 scoped_refptr<LayerAnimationController> GetAnimationControllerForId(int id); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 AnimationControllerMap all_animation_controllers_; | 82 AnimationControllerMap all_animation_controllers_; |
81 | 83 |
82 bool supports_scroll_animations_; | 84 bool supports_scroll_animations_; |
83 | 85 |
84 DISALLOW_COPY_AND_ASSIGN(AnimationRegistrar); | 86 DISALLOW_COPY_AND_ASSIGN(AnimationRegistrar); |
85 }; | 87 }; |
86 | 88 |
87 } // namespace cc | 89 } // namespace cc |
88 | 90 |
89 #endif // CC_ANIMATION_ANIMATION_REGISTRAR_H_ | 91 #endif // CC_ANIMATION_ANIMATION_REGISTRAR_H_ |
OLD | NEW |