Index: ui/gfx/compositor/layer_animation_sequence.h |
diff --git a/ui/gfx/compositor/layer_animation_sequence.h b/ui/gfx/compositor/layer_animation_sequence.h |
index 4670587880cfd7a6e2316ced81138095f4f56524..8f377840107c4c790c51c9842b4c7e190286415b 100644 |
--- a/ui/gfx/compositor/layer_animation_sequence.h |
+++ b/ui/gfx/compositor/layer_animation_sequence.h |
@@ -9,6 +9,7 @@ |
#include <vector> |
#include "base/memory/linked_ptr.h" |
+#include "base/observer_list.h" |
#include "base/time.h" |
#include "ui/gfx/compositor/compositor_export.h" |
#include "ui/gfx/compositor/layer_animation_element.h" |
@@ -16,6 +17,7 @@ |
namespace ui { |
class LayerAnimationDelegate; |
+class LayerAnimationObserver; |
// Contains a collection of layer animation elements to be played one after |
// another. Although it has a similar interface to LayerAnimationElement, it is |
@@ -67,6 +69,14 @@ class COMPOSITOR_EXPORT LayerAnimationSequence { |
bool HasCommonProperty( |
const LayerAnimationElement::AnimatableProperties& other) const; |
+ // These functions are used for adding or removing observers from the observer |
+ // list. The observers are notified when animations end. |
+ void AddObserver(LayerAnimationObserver* observer); |
+ void RemoveObserver(LayerAnimationObserver* observer); |
+ |
+ // Notifies the observers that this sequence has ended. |
+ void NotifyEnded(); |
+ |
private: |
typedef std::vector<linked_ptr<LayerAnimationElement> > Elements; |
@@ -86,6 +96,9 @@ class COMPOSITOR_EXPORT LayerAnimationSequence { |
size_t last_element_; |
base::TimeDelta last_start_; |
+ // These parties are notified when layer animations end. |
+ ObserverList<LayerAnimationObserver> observers_; |
+ |
DISALLOW_COPY_AND_ASSIGN(LayerAnimationSequence); |
}; |