| 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_LAYER_ANIMATION_CONTROLLER_H_ | 5 #ifndef CC_ANIMATION_LAYER_ANIMATION_CONTROLLER_H_ |
| 6 #define CC_ANIMATION_LAYER_ANIMATION_CONTROLLER_H_ | 6 #define CC_ANIMATION_LAYER_ANIMATION_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <vector> |
| 9 |
| 8 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 9 #include "base/containers/hash_tables.h" | 11 #include "base/containers/hash_tables.h" |
| 10 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 11 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/observer_list.h" | 14 #include "base/observer_list.h" |
| 13 #include "base/time/time.h" | 15 #include "base/time/time.h" |
| 14 #include "cc/animation/animation_events.h" | 16 #include "cc/animation/animation_events.h" |
| 15 #include "cc/animation/layer_animation_event_observer.h" | 17 #include "cc/animation/layer_animation_event_observer.h" |
| 16 #include "cc/base/cc_export.h" | 18 #include "cc/base/cc_export.h" |
| 17 #include "cc/base/scoped_ptr_vector.h" | |
| 18 #include "ui/gfx/geometry/scroll_offset.h" | 19 #include "ui/gfx/geometry/scroll_offset.h" |
| 19 #include "ui/gfx/transform.h" | 20 #include "ui/gfx/transform.h" |
| 20 | 21 |
| 21 namespace gfx { | 22 namespace gfx { |
| 22 class BoxF; | 23 class BoxF; |
| 23 class Transform; | 24 class Transform; |
| 24 } | 25 } |
| 25 | 26 |
| 26 namespace cc { | 27 namespace cc { |
| 27 | 28 |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 bool notify_active_observers, | 218 bool notify_active_observers, |
| 218 bool notify_pending_observers); | 219 bool notify_pending_observers); |
| 219 | 220 |
| 220 void UpdatePotentiallyAnimatingTransform(); | 221 void UpdatePotentiallyAnimatingTransform(); |
| 221 | 222 |
| 222 bool HasValueObserver(); | 223 bool HasValueObserver(); |
| 223 bool HasActiveValueObserver(); | 224 bool HasActiveValueObserver(); |
| 224 | 225 |
| 225 AnimationRegistrar* registrar_; | 226 AnimationRegistrar* registrar_; |
| 226 int id_; | 227 int id_; |
| 227 ScopedPtrVector<Animation> animations_; | 228 std::vector<scoped_ptr<Animation>> animations_; |
| 228 | 229 |
| 229 // This is used to ensure that we don't spam the registrar. | 230 // This is used to ensure that we don't spam the registrar. |
| 230 bool is_active_; | 231 bool is_active_; |
| 231 | 232 |
| 232 base::TimeTicks last_tick_time_; | 233 base::TimeTicks last_tick_time_; |
| 233 | 234 |
| 234 base::ObserverList<LayerAnimationValueObserver> value_observers_; | 235 base::ObserverList<LayerAnimationValueObserver> value_observers_; |
| 235 base::ObserverList<LayerAnimationEventObserver> event_observers_; | 236 base::ObserverList<LayerAnimationEventObserver> event_observers_; |
| 236 | 237 |
| 237 LayerAnimationValueProvider* value_provider_; | 238 LayerAnimationValueProvider* value_provider_; |
| 238 | 239 |
| 239 AnimationDelegate* layer_animation_delegate_; | 240 AnimationDelegate* layer_animation_delegate_; |
| 240 | 241 |
| 241 // Only try to start animations when new animations are added or when the | 242 // Only try to start animations when new animations are added or when the |
| 242 // previous attempt at starting animations failed to start all animations. | 243 // previous attempt at starting animations failed to start all animations. |
| 243 bool needs_to_start_animations_; | 244 bool needs_to_start_animations_; |
| 244 | 245 |
| 245 bool scroll_offset_animation_was_interrupted_; | 246 bool scroll_offset_animation_was_interrupted_; |
| 246 | 247 |
| 247 bool potentially_animating_transform_for_active_observers_; | 248 bool potentially_animating_transform_for_active_observers_; |
| 248 bool potentially_animating_transform_for_pending_observers_; | 249 bool potentially_animating_transform_for_pending_observers_; |
| 249 | 250 |
| 250 DISALLOW_COPY_AND_ASSIGN(LayerAnimationController); | 251 DISALLOW_COPY_AND_ASSIGN(LayerAnimationController); |
| 251 }; | 252 }; |
| 252 | 253 |
| 253 } // namespace cc | 254 } // namespace cc |
| 254 | 255 |
| 255 #endif // CC_ANIMATION_LAYER_ANIMATION_CONTROLLER_H_ | 256 #endif // CC_ANIMATION_LAYER_ANIMATION_CONTROLLER_H_ |
| OLD | NEW |