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

Unified Diff: Source/web/ChromeClientImpl.cpp

Issue 946323002: Animations: Introduce compositor AnimationPlayer and AnimationTimeline. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Support multiple timelines. Created 5 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/web/ChromeClientImpl.cpp
diff --git a/Source/web/ChromeClientImpl.cpp b/Source/web/ChromeClientImpl.cpp
index fe36f0c5799ee616b80c4fcd6342cc471e144c6f..606a744527bbfdd7a3b14c839e06bbfea32cc572 100644
--- a/Source/web/ChromeClientImpl.cpp
+++ b/Source/web/ChromeClientImpl.cpp
@@ -107,6 +107,8 @@
namespace blink {
+class WebCompositorAnimationTimeline;
+
// Converts a AXObjectCache::AXNotification to a WebAXEvent
static WebAXEvent toWebAXEvent(AXObjectCache::AXNotification notification)
{
@@ -708,6 +710,44 @@ void ChromeClientImpl::attachRootGraphicsLayer(GraphicsLayer* rootLayer, LocalFr
}
}
+void ChromeClientImpl::attachCompositorAnimationTimeline(WebCompositorAnimationTimeline* compositorTimeline, LocalFrame* localRoot)
+{
+ // FIXME: For top-level frames we still use the WebView as a WebWidget. This special
+ // case will be removed when top-level frames get WebFrameWidgets.
+ if (localRoot->isMainFrame()) {
+ m_webView->attachCompositorAnimationTimeline(compositorTimeline);
+ } else {
+ WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(localRoot);
+ // FIXME: The following conditional is only needed for staging until the Chromium patch
+ // lands that instantiates a WebFrameWidget.
+ if (!webFrame->frameWidget()) {
+ m_webView->attachCompositorAnimationTimeline(compositorTimeline);
+ return;
+ }
+ ASSERT(webFrame && webFrame->frameWidget());
+ webFrame->frameWidget()->attachCompositorAnimationTimeline(compositorTimeline);
+ }
+}
+
+void ChromeClientImpl::detachCompositorAnimationTimeline(WebCompositorAnimationTimeline* compositorTimeline, LocalFrame* localRoot)
+{
+ // FIXME: For top-level frames we still use the WebView as a WebWidget. This special
+ // case will be removed when top-level frames get WebFrameWidgets.
+ if (localRoot->isMainFrame()) {
+ m_webView->detachCompositorAnimationTimeline(compositorTimeline);
+ } else {
+ WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(localRoot);
+ // FIXME: The following conditional is only needed for staging until the Chromium patch
+ // lands that instantiates a WebFrameWidget.
+ if (!webFrame->frameWidget()) {
+ m_webView->detachCompositorAnimationTimeline(compositorTimeline);
+ return;
+ }
+ ASSERT(webFrame && webFrame->frameWidget());
+ webFrame->frameWidget()->detachCompositorAnimationTimeline(compositorTimeline);
+ }
+}
+
void ChromeClientImpl::enterFullScreenForElement(Element* element)
{
m_webView->enterFullScreenForElement(element);

Powered by Google App Engine
This is Rietveld 408576698