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

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

Issue 9222018: reland -- Disable animations during aura tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Gardening 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
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
« 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