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

Unified Diff: ui/gfx/compositor/layer_animation_sequence.cc

Issue 8395046: Allows observers to be notified when layer animations complete. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge with master Created 9 years, 2 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
Index: ui/gfx/compositor/layer_animation_sequence.cc
diff --git a/ui/gfx/compositor/layer_animation_sequence.cc b/ui/gfx/compositor/layer_animation_sequence.cc
index 8f34969d6801439cc6cc3e639da280662bec38e0..11b00df664ec1330cbe8697c7d5920b55d59e880 100644
--- a/ui/gfx/compositor/layer_animation_sequence.cc
+++ b/ui/gfx/compositor/layer_animation_sequence.cc
@@ -10,6 +10,7 @@
#include "base/debug/trace_event.h"
#include "ui/gfx/compositor/layer_animation_delegate.h"
#include "ui/gfx/compositor/layer_animation_element.h"
+#include "ui/gfx/compositor/layer_animation_observer.h"
namespace ui {
@@ -106,4 +107,19 @@ bool LayerAnimationSequence::HasCommonProperty(
return intersection.size() > 0;
}
+void LayerAnimationSequence::AddObserver(LayerAnimationObserver* observer) {
+ if (!observers_.HasObserver(observer))
+ observers_.AddObserver(observer);
+}
+
+void LayerAnimationSequence::RemoveObserver(LayerAnimationObserver* observer) {
+ observers_.RemoveObserver(observer);
+}
+
+void LayerAnimationSequence::NotifyEnded() {
+ FOR_EACH_OBSERVER(LayerAnimationObserver,
+ observers_,
+ OnLayerAnimationEnded(this));
+}
+
} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698