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

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

Issue 1471193008: Devtools Animations: Maintain playback rate on navigation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 9244515ab55f6f814238b303a8c61c3547144b18..263d98939861a63c6dfad6e23a0c0c3923db957c 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorAnimationAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorAnimationAgent.cpp
@@ -34,6 +34,7 @@
namespace AnimationAgentState {
static const char animationAgentEnabled[] = "animationAgentEnabled";
+static const char animationAgentPlaybackRate[] = "animationAgentPlaybackRate";
}
namespace blink {
@@ -53,6 +54,8 @@ void InspectorAnimationAgent::restore()
if (m_state->getBoolean(AnimationAgentState::animationAgentEnabled)) {
ErrorString error;
enable(&error);
+ double playbackRate = m_state->getDouble(AnimationAgentState::animationAgentPlaybackRate, 1);
+ setPlaybackRate(nullptr, playbackRate);
}
}
@@ -83,6 +86,8 @@ void InspectorAnimationAgent::didCommitLoadForLocalFrame(LocalFrame* frame)
m_idToAnimationClone.clear();
m_clearedAnimations.clear();
}
+ double playbackRate = m_state->getDouble(AnimationAgentState::animationAgentPlaybackRate, 1);
+ setPlaybackRate(nullptr, playbackRate);
}
static PassRefPtr<TypeBuilder::Animation::AnimationEffect> buildObjectForAnimationEffect(KeyframeEffect* effect, bool isTransition)
@@ -201,6 +206,7 @@ void InspectorAnimationAgent::setPlaybackRate(ErrorString*, double playbackRate)
{
for (LocalFrame* frame : *m_inspectedFrames)
frame->document()->timeline().setPlaybackRate(playbackRate);
+ m_state->setDouble(AnimationAgentState::animationAgentPlaybackRate, playbackRate);
}
void InspectorAnimationAgent::getCurrentTime(ErrorString* errorString, const String& id, double* currentTime)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698