Index: ui/gfx/compositor/layer_animation_observer.h |
diff --git a/ui/gfx/compositor/layer_animation_observer.h b/ui/gfx/compositor/layer_animation_observer.h |
index c35dc60cbae411a1cd1917d7647d295dba4ceb26..3f29f6501b938cbe9b35baa26c3bd54454119ff1 100644 |
--- a/ui/gfx/compositor/layer_animation_observer.h |
+++ b/ui/gfx/compositor/layer_animation_observer.h |
@@ -16,6 +16,7 @@ namespace ui { |
class LayerAnimationSequence; |
class ScopedLayerAnimationSettings; |
+class ImplicitAnimationObserver; |
// LayerAnimationObservers are notified when animations complete. |
class COMPOSITOR_EXPORT LayerAnimationObserver { |
@@ -33,6 +34,10 @@ class COMPOSITOR_EXPORT LayerAnimationObserver { |
virtual void OnLayerAnimationScheduled( |
const LayerAnimationSequence* sequence) = 0; |
+ protected: |
+ LayerAnimationObserver(); |
+ virtual ~LayerAnimationObserver(); |
+ |
// If the animator is destroyed during an animation, the animations are |
// aborted. The resulting NotifyAborted notifications will NOT be sent to |
// this observer if this function returns false. NOTE: IF YOU OVERRIDE THIS |
@@ -40,9 +45,11 @@ class COMPOSITOR_EXPORT LayerAnimationObserver { |
// OBSERVER WHEN YOU ARE DESTROYED. |
virtual bool RequiresNotificationWhenAnimatorDestroyed() const; |
- protected: |
- LayerAnimationObserver(); |
- virtual ~LayerAnimationObserver(); |
+ // Called when |this| is added to |sequence|'s observer list. |
+ virtual void OnAttachedToSequence(LayerAnimationSequence* sequence); |
sky
2012/01/30 15:58:55
Where is this invoked from?
|
+ |
+ // Called when |this| is removed to |sequence|'s observer list. |
+ virtual void OnDetachedFromSequence(LayerAnimationSequence* sequence); |
private: |
friend class LayerAnimationSequence; |
@@ -67,13 +74,11 @@ class COMPOSITOR_EXPORT ImplicitAnimationObserver |
virtual void OnImplicitAnimationsCompleted() = 0; |
- private: |
- friend class ScopedLayerAnimationSettings; |
- |
// OnImplicitAnimationsCompleted is not fired unless the observer is active. |
bool active() const { return active_; } |
void SetActive(bool active); |
+ private: |
// LayerAnimationObserver implementation |
virtual void OnLayerAnimationEnded( |
const LayerAnimationSequence* sequence) OVERRIDE; |
@@ -81,15 +86,19 @@ class COMPOSITOR_EXPORT ImplicitAnimationObserver |
const LayerAnimationSequence* sequence) OVERRIDE; |
virtual void OnLayerAnimationScheduled( |
const LayerAnimationSequence* sequence) OVERRIDE; |
+ virtual void OnAttachedToSequence( |
+ LayerAnimationSequence* sequence) OVERRIDE; |
+ virtual void OnDetachedFromSequence( |
+ LayerAnimationSequence* sequence) OVERRIDE; |
void CheckCompleted(); |
bool active_; |
- // This tracks the number of scheduled animations that have yet to complete. |
- // If this value is zero, and the observer is active, then |
+ // This tracks the scheduled animations that have yet to complete. |
+ // When this is empty, and the observer is active, then |
// OnImplicitAnimationsCompleted is fired. |
- size_t animation_count_; |
+ std::set<const LayerAnimationSequence*> unfinished_animations_; |
sky
2012/01/30 15:58:55
Is this the same as attached_sequences_?
|
}; |
} // namespace ui |