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

Unified Diff: third_party/WebKit/Source/core/inspector/InspectorAnimationAgent.cpp

Issue 1422713012: Devtools Animations: Listen to all animation play state changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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: third_party/WebKit/Source/core/inspector/InspectorAnimationAgent.cpp
diff --git a/third_party/WebKit/Source/core/inspector/InspectorAnimationAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorAnimationAgent.cpp
index d0ebccf39a5b2f558fe67d1910272fb9adc3c782..26fff39f43000ab5e9090e302b05424114ee4de2 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorAnimationAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorAnimationAgent.cpp
@@ -423,17 +423,15 @@ void InspectorAnimationAgent::didCreateAnimation(unsigned sequenceNumber)
frontend()->animationCreated(String::number(sequenceNumber));
}
-void InspectorAnimationAgent::didCancelAnimation(unsigned sequenceNumber)
-{
- frontend()->animationCanceled(String::number(sequenceNumber));
-}
-
-void InspectorAnimationAgent::didStartAnimation(Animation* animation)
+void InspectorAnimationAgent::animationPlayStateChanged(Animation* animation, Animation::AnimationPlayState oldPlayState, Animation::AnimationPlayState newPlayState)
{
const String& animationId = String::number(animation->sequenceNumber());
if (m_idToAnimation.get(animationId))
return;
- frontend()->animationStarted(buildObjectForAnimation(*animation));
+ if (newPlayState == Animation::Running || newPlayState == Animation::Finished)
+ frontend()->animationStarted(buildObjectForAnimation(*animation));
+ else if (newPlayState == Animation::Idle || newPlayState == Animation::Paused)
+ frontend()->animationCanceled(animationId);
}
void InspectorAnimationAgent::didClearDocumentOfWindowObject(LocalFrame* frame)

Powered by Google App Engine
This is Rietveld 408576698