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

Side by Side 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: Created 5 years, 10 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 16 matching lines...) Expand all
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32 #include "config.h" 32 #include "config.h"
33 #include "web/ChromeClientImpl.h" 33 #include "web/ChromeClientImpl.h"
34 34
35 #include "bindings/core/v8/ScriptController.h" 35 #include "bindings/core/v8/ScriptController.h"
36 #include "core/HTMLNames.h" 36 #include "core/HTMLNames.h"
37 #include "core/animation/AnimationTimeline.h"
37 #include "core/dom/AXObjectCache.h" 38 #include "core/dom/AXObjectCache.h"
38 #include "core/dom/Document.h" 39 #include "core/dom/Document.h"
39 #include "core/dom/Fullscreen.h" 40 #include "core/dom/Fullscreen.h"
40 #include "core/dom/Node.h" 41 #include "core/dom/Node.h"
41 #include "core/frame/Console.h" 42 #include "core/frame/Console.h"
42 #include "core/frame/FrameHost.h" 43 #include "core/frame/FrameHost.h"
43 #include "core/frame/FrameView.h" 44 #include "core/frame/FrameView.h"
44 #include "core/frame/Settings.h" 45 #include "core/frame/Settings.h"
45 #include "core/html/HTMLInputElement.h" 46 #include "core/html/HTMLInputElement.h"
46 #include "core/html/forms/ColorChooser.h" 47 #include "core/html/forms/ColorChooser.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 #include "web/WebPopupMenuImpl.h" 101 #include "web/WebPopupMenuImpl.h"
101 #include "web/WebSettingsImpl.h" 102 #include "web/WebSettingsImpl.h"
102 #include "web/WebViewImpl.h" 103 #include "web/WebViewImpl.h"
103 #include "wtf/text/CString.h" 104 #include "wtf/text/CString.h"
104 #include "wtf/text/StringBuilder.h" 105 #include "wtf/text/StringBuilder.h"
105 #include "wtf/text/StringConcatenate.h" 106 #include "wtf/text/StringConcatenate.h"
106 #include "wtf/unicode/CharacterNames.h" 107 #include "wtf/unicode/CharacterNames.h"
107 108
108 namespace blink { 109 namespace blink {
109 110
111 class WebCompositorAnimationTimeline;
112
110 // Converts a AXObjectCache::AXNotification to a WebAXEvent 113 // Converts a AXObjectCache::AXNotification to a WebAXEvent
111 static WebAXEvent toWebAXEvent(AXObjectCache::AXNotification notification) 114 static WebAXEvent toWebAXEvent(AXObjectCache::AXNotification notification)
112 { 115 {
113 // These enums have the same values; enforced in AssertMatchingEnums.cpp. 116 // These enums have the same values; enforced in AssertMatchingEnums.cpp.
114 return static_cast<WebAXEvent>(notification); 117 return static_cast<WebAXEvent>(notification);
115 } 118 }
116 119
117 static WebSelectionBound toWebSelectionBound(const CompositedSelectionBound& bou nd) 120 static WebSelectionBound toWebSelectionBound(const CompositedSelectionBound& bou nd)
118 { 121 {
119 ASSERT(bound.layer); 122 ASSERT(bound.layer);
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 return false; 698 return false;
696 } 699 }
697 700
698 GraphicsLayerFactory* ChromeClientImpl::graphicsLayerFactory() const 701 GraphicsLayerFactory* ChromeClientImpl::graphicsLayerFactory() const
699 { 702 {
700 return m_webView->graphicsLayerFactory(); 703 return m_webView->graphicsLayerFactory();
701 } 704 }
702 705
703 void ChromeClientImpl::attachRootGraphicsLayer(GraphicsLayer* rootLayer, LocalFr ame* localRoot) 706 void ChromeClientImpl::attachRootGraphicsLayer(GraphicsLayer* rootLayer, LocalFr ame* localRoot)
704 { 707 {
708 WebCompositorAnimationTimeline* compositorTimeline = rootLayer && localRoot- >document() ? localRoot->document()->timeline().compositorTimeline() : nullptr;
709
705 // FIXME: For top-level frames we still use the WebView as a WebWidget. This special 710 // FIXME: For top-level frames we still use the WebView as a WebWidget. This special
706 // case will be removed when top-level frames get WebFrameWidgets. 711 // case will be removed when top-level frames get WebFrameWidgets.
707 if (localRoot->isMainFrame()) { 712 if (localRoot->isMainFrame()) {
713 m_webView->setCompositorAnimationTimeline(compositorTimeline);
708 m_webView->setRootGraphicsLayer(rootLayer); 714 m_webView->setRootGraphicsLayer(rootLayer);
709 } else { 715 } else {
710 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(localRoot); 716 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(localRoot);
711 // FIXME: The following conditional is only needed for staging until the Chromium patch 717 // FIXME: The following conditional is only needed for staging until the Chromium patch
712 // lands that instantiates a WebFrameWidget. 718 // lands that instantiates a WebFrameWidget.
713 if (!webFrame->frameWidget()) { 719 if (!webFrame->frameWidget()) {
720 m_webView->setCompositorAnimationTimeline(compositorTimeline);
714 m_webView->setRootGraphicsLayer(rootLayer); 721 m_webView->setRootGraphicsLayer(rootLayer);
715 return; 722 return;
716 } 723 }
717 ASSERT(webFrame && webFrame->frameWidget()); 724 ASSERT(webFrame && webFrame->frameWidget());
725 webFrame->frameWidget()->setCompositorAnimationTimeline(compositorTimeli ne);
718 webFrame->frameWidget()->setRootGraphicsLayer(rootLayer); 726 webFrame->frameWidget()->setRootGraphicsLayer(rootLayer);
719 } 727 }
720 } 728 }
721 729
722 void ChromeClientImpl::enterFullScreenForElement(Element* element) 730 void ChromeClientImpl::enterFullScreenForElement(Element* element)
723 { 731 {
724 m_webView->enterFullScreenForElement(element); 732 m_webView->enterFullScreenForElement(element);
725 } 733 }
726 734
727 void ChromeClientImpl::exitFullScreenForElement(Element* element) 735 void ChromeClientImpl::exitFullScreenForElement(Element* element)
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
890 webframe->autofillClient()->dataListOptionsChanged(WebInputElement(&inpu t)); 898 webframe->autofillClient()->dataListOptionsChanged(WebInputElement(&inpu t));
891 } 899 }
892 900
893 void ChromeClientImpl::registerViewportLayers() const 901 void ChromeClientImpl::registerViewportLayers() const
894 { 902 {
895 if (m_webView->rootGraphicsLayer() && m_webView->layerTreeView() && m_webVie w->pinchVirtualViewportEnabled()) 903 if (m_webView->rootGraphicsLayer() && m_webView->layerTreeView() && m_webVie w->pinchVirtualViewportEnabled())
896 m_webView->page()->frameHost().pinchViewport().registerLayersWithTreeVie w(m_webView->layerTreeView()); 904 m_webView->page()->frameHost().pinchViewport().registerLayersWithTreeVie w(m_webView->layerTreeView());
897 } 905 }
898 906
899 } // namespace blink 907 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698