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

Unified Diff: ui/gfx/compositor/layer_animation_observer.h

Issue 9320018: Revert 120092 - Reland 120074 -- Disable animations during aura tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/aura/window_unittest.cc ('k') | ui/gfx/compositor/layer_animation_observer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/compositor/layer_animation_observer.h
===================================================================
--- ui/gfx/compositor/layer_animation_observer.h (revision 120096)
+++ ui/gfx/compositor/layer_animation_observer.h (working copy)
@@ -16,30 +16,23 @@
class LayerAnimationSequence;
class ScopedLayerAnimationSettings;
-class ImplicitAnimationObserver;
// LayerAnimationObservers are notified when animations complete.
class COMPOSITOR_EXPORT LayerAnimationObserver {
public:
// Called when the |sequence| ends. Not called if |sequence| is aborted.
virtual void OnLayerAnimationEnded(
- LayerAnimationSequence* sequence) = 0;
+ const LayerAnimationSequence* sequence) = 0;
// Called if |sequence| is aborted for any reason. Should never do anything
// that may cause another animation to be started.
virtual void OnLayerAnimationAborted(
- LayerAnimationSequence* sequence) = 0;
+ const LayerAnimationSequence* sequence) = 0;
// Called when the animation is scheduled.
virtual void OnLayerAnimationScheduled(
- LayerAnimationSequence* sequence) = 0;
+ const LayerAnimationSequence* sequence) = 0;
- protected:
- typedef std::set<LayerAnimationSequence*> AttachedSequences;
-
- 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
@@ -47,19 +40,10 @@
// OBSERVER WHEN YOU ARE DESTROYED.
virtual bool RequiresNotificationWhenAnimatorDestroyed() const;
- // Called when |this| is added to |sequence|'s observer list.
- virtual void OnAttachedToSequence(LayerAnimationSequence* sequence);
+ protected:
+ LayerAnimationObserver();
+ virtual ~LayerAnimationObserver();
- // Called when |this| is removed to |sequence|'s observer list.
- virtual void OnDetachedFromSequence(LayerAnimationSequence* sequence);
-
- // Detaches this observer from all sequences it is currently observing.
- void StopObserving();
-
- const AttachedSequences& attached_sequences() const {
- return attached_sequences_;
- }
-
private:
friend class LayerAnimationSequence;
@@ -69,7 +53,7 @@
// Called when |this| is removed to |sequence|'s observer list.
void DetachedFromSequence(LayerAnimationSequence* sequence);
- AttachedSequences attached_sequences_;
+ std::set<LayerAnimationSequence*> attached_sequences_;
};
// An implicit animation observer is intended to be used in conjunction with a
@@ -83,33 +67,29 @@
virtual void OnImplicitAnimationsCompleted() = 0;
- protected:
- // Deactivates the observer and clears the collection of animations it is
- // waiting for.
- void StopObservingImplicitAnimations();
-
private:
friend class ScopedLayerAnimationSettings;
+ // OnImplicitAnimationsCompleted is not fired unless the observer is active.
+ bool active() const { return active_; }
+ void SetActive(bool active);
+
// LayerAnimationObserver implementation
virtual void OnLayerAnimationEnded(
- LayerAnimationSequence* sequence) OVERRIDE;
+ const LayerAnimationSequence* sequence) OVERRIDE;
virtual void OnLayerAnimationAborted(
- LayerAnimationSequence* sequence) OVERRIDE;
+ const LayerAnimationSequence* sequence) OVERRIDE;
virtual void OnLayerAnimationScheduled(
- LayerAnimationSequence* sequence) OVERRIDE;
- virtual void OnAttachedToSequence(
- LayerAnimationSequence* sequence) OVERRIDE;
- virtual void OnDetachedFromSequence(
- LayerAnimationSequence* sequence) OVERRIDE;
+ const LayerAnimationSequence* sequence) OVERRIDE;
- // OnImplicitAnimationsCompleted is not fired unless the observer is active.
- bool active() const { return active_; }
- void SetActive(bool active);
-
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
+ // OnImplicitAnimationsCompleted is fired.
+ size_t animation_count_;
};
} // namespace ui
« no previous file with comments | « ui/aura/window_unittest.cc ('k') | ui/gfx/compositor/layer_animation_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698