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

Unified Diff: Source/core/animation/AnimationPlayer.h

Issue 210363007: Declare onFinish event handler for AnimationPlayer (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Use ContextLifecycleObserver Created 6 years, 9 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: Source/core/animation/AnimationPlayer.h
diff --git a/Source/core/animation/AnimationPlayer.h b/Source/core/animation/AnimationPlayer.h
index e8b79ba703ce94f39fd465026292a92e015d2863..ad680b48432f7f717589a9a679dc8c18f5df5e81 100644
--- a/Source/core/animation/AnimationPlayer.h
+++ b/Source/core/animation/AnimationPlayer.h
@@ -32,6 +32,8 @@
#define AnimationPlayer_h
#include "core/animation/TimedItem.h"
+#include "core/dom/ContextLifecycleObserver.h"
+#include "core/events/EventTarget.h"
#include "wtf/RefPtr.h"
namespace WebCore {
@@ -39,11 +41,11 @@ namespace WebCore {
class DocumentTimeline;
class ExceptionState;
-class AnimationPlayer FINAL : public RefCounted<AnimationPlayer> {
-
+class AnimationPlayer FINAL : public RefCounted<AnimationPlayer>, public ContextLifecycleObserver, public EventTargetWithInlineData {
+ REFCOUNTED_EVENT_TARGET(AnimationPlayer);
public:
~AnimationPlayer();
- static PassRefPtr<AnimationPlayer> create(DocumentTimeline&, TimedItem*);
+ static PassRefPtr<AnimationPlayer> create(ExecutionContext*, DocumentTimeline&, TimedItem*);
// Returns whether this player is still current or in effect.
bool update();
@@ -66,6 +68,11 @@ public:
void finish(ExceptionState&);
bool finished() { return limited(currentTime()); }
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(finish);
+
+ virtual const AtomicString& interfaceName() const OVERRIDE;
+ virtual ExecutionContext* executionContext() const OVERRIDE;
+
double playbackRate() const { return m_playbackRate; }
void setPlaybackRate(double);
const DocumentTimeline* timeline() const { return m_timeline; }
@@ -118,7 +125,7 @@ public:
}
private:
- AnimationPlayer(DocumentTimeline&, TimedItem*);
+ AnimationPlayer(ExecutionContext*, DocumentTimeline&, TimedItem*);
double sourceEnd() const;
bool limited(double currentTime) const;
double currentTimeWithoutLag() const;

Powered by Google App Engine
This is Rietveld 408576698