OLD | NEW |
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 770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
781 WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(obj->getDocument(
)->axObjectCacheOwner().frame()); | 781 WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(obj->getDocument(
)->axObjectCacheOwner().frame()); |
782 if (webframe && webframe->client()) | 782 if (webframe && webframe->client()) |
783 webframe->client()->postAccessibilityEvent(WebAXObject(obj), toWebAXEven
t(notification)); | 783 webframe->client()->postAccessibilityEvent(WebAXObject(obj), toWebAXEven
t(notification)); |
784 } | 784 } |
785 | 785 |
786 String ChromeClientImpl::acceptLanguages() | 786 String ChromeClientImpl::acceptLanguages() |
787 { | 787 { |
788 return m_webView->client()->acceptLanguages(); | 788 return m_webView->client()->acceptLanguages(); |
789 } | 789 } |
790 | 790 |
791 void ChromeClientImpl::attachRootGraphicsLayer(GraphicsLayer* rootLayer, LocalFr
ame* localRoot) | 791 void ChromeClientImpl::attachRootGraphicsLayer(GraphicsLayer* rootLayer, LocalFr
ame* localFrame) |
792 { | 792 { |
793 // FIXME: For top-level frames we still use the WebView as a WebWidget. This | 793 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(localFrame)->loca
lRoot(); |
794 // special case will be removed when top-level frames get WebFrameWidgets. | 794 |
795 if (localRoot->isMainFrame()) { | 795 // This method can be called while the frame is being detached. In that |
796 m_webView->setRootGraphicsLayer(rootLayer); | 796 // case, the rootLayer is null, and the widget is already destroyed. |
797 } else { | 797 DCHECK(webFrame->frameWidget() || !rootLayer); |
798 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(localRoot); | 798 if (webFrame->frameWidget()) |
799 // FIXME: The following conditional is only needed for staging until the | 799 webFrame->frameWidget()->setRootGraphicsLayer(rootLayer); |
800 // Chromium patch lands that instantiates a WebFrameWidget. | |
801 if (!webFrame->frameWidget()) { | |
802 m_webView->setRootGraphicsLayer(rootLayer); | |
803 return; | |
804 } | |
805 DCHECK(webFrame); | |
806 DCHECK(webFrame->frameWidget()); | |
807 toWebFrameWidgetImpl(webFrame->frameWidget())->setRootGraphicsLayer(root
Layer); | |
808 } | |
809 } | 800 } |
810 | 801 |
811 void ChromeClientImpl::didPaint(const PaintArtifact& paintArtifact) | 802 void ChromeClientImpl::didPaint(const PaintArtifact& paintArtifact) |
812 { | 803 { |
813 // TODO(jbroman): This doesn't handle OOPIF correctly. We probably need a | 804 // TODO(jbroman): This doesn't handle OOPIF correctly. We probably need a |
814 // branch for WebFrameWidget, like attachRootGraphicsLayer. | 805 // branch for WebFrameWidget, like attachRootGraphicsLayer. |
815 m_webView->getPaintArtifactCompositor().update(paintArtifact); | 806 m_webView->getPaintArtifactCompositor().update(paintArtifact); |
816 } | 807 } |
817 | 808 |
818 void ChromeClientImpl::attachCompositorAnimationTimeline(CompositorAnimationTime
line* compositorTimeline, LocalFrame* localRoot) | 809 void ChromeClientImpl::attachCompositorAnimationTimeline(CompositorAnimationTime
line* compositorTimeline, LocalFrame* localFrame) |
819 { | 810 { |
820 // FIXME: For top-level frames we still use the WebView as a WebWidget. This | 811 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(localFrame)->loca
lRoot(); |
821 // special case will be removed when top-level frames get WebFrameWidgets. | 812 webFrame->frameWidget()->attachCompositorAnimationTimeline(compositorTimelin
e); |
822 if (localRoot->isMainFrame()) { | |
823 m_webView->attachCompositorAnimationTimeline(compositorTimeline); | |
824 } else { | |
825 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(localRoot); | |
826 // FIXME: The following conditional is only needed for staging until the | |
827 // Chromium patch lands that instantiates a WebFrameWidget. | |
828 if (!webFrame->frameWidget()) { | |
829 m_webView->attachCompositorAnimationTimeline(compositorTimeline); | |
830 return; | |
831 } | |
832 DCHECK(webFrame); | |
833 DCHECK(webFrame->frameWidget()); | |
834 toWebFrameWidgetImpl(webFrame->frameWidget())->attachCompositorAnimation
Timeline(compositorTimeline); | |
835 } | |
836 } | 813 } |
837 | 814 |
838 void ChromeClientImpl::detachCompositorAnimationTimeline(CompositorAnimationTime
line* compositorTimeline, LocalFrame* localRoot) | 815 void ChromeClientImpl::detachCompositorAnimationTimeline(CompositorAnimationTime
line* compositorTimeline, LocalFrame* localFrame) |
839 { | 816 { |
840 // FIXME: For top-level frames we still use the WebView as a WebWidget. This | 817 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(localFrame)->loca
lRoot(); |
841 // special case will be removed when top-level frames get WebFrameWidgets. | 818 |
842 if (localRoot->isMainFrame()) { | 819 // This method can be called when the frame is being detached, after the |
843 m_webView->detachCompositorAnimationTimeline(compositorTimeline); | 820 // widget is destroyed. |
844 } else { | 821 if (webFrame->frameWidget()) |
845 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(localRoot); | 822 webFrame->frameWidget()->detachCompositorAnimationTimeline(compositorTim
eline); |
846 // FIXME: The following conditional is only needed for staging until the | |
847 // Chromium patch lands that instantiates a WebFrameWidget. | |
848 if (!webFrame->frameWidget()) { | |
849 m_webView->detachCompositorAnimationTimeline(compositorTimeline); | |
850 return; | |
851 } | |
852 DCHECK(webFrame); | |
853 DCHECK(webFrame->frameWidget()); | |
854 toWebFrameWidgetImpl(webFrame->frameWidget())->detachCompositorAnimation
Timeline(compositorTimeline); | |
855 } | |
856 } | 823 } |
857 | 824 |
858 void ChromeClientImpl::enterFullScreenForElement(Element* element) | 825 void ChromeClientImpl::enterFullScreenForElement(Element* element) |
859 { | 826 { |
860 m_webView->enterFullScreenForElement(element); | 827 m_webView->enterFullScreenForElement(element); |
861 } | 828 } |
862 | 829 |
863 void ChromeClientImpl::exitFullScreenForElement(Element* element) | 830 void ChromeClientImpl::exitFullScreenForElement(Element* element) |
864 { | 831 { |
865 m_webView->exitFullScreenForElement(element); | 832 m_webView->exitFullScreenForElement(element); |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1119 { | 1086 { |
1120 return wrapUnique(m_webView->scheduler()->createFrameScheduler(blameContext)
.release()); | 1087 return wrapUnique(m_webView->scheduler()->createFrameScheduler(blameContext)
.release()); |
1121 } | 1088 } |
1122 | 1089 |
1123 double ChromeClientImpl::lastFrameTimeMonotonic() const | 1090 double ChromeClientImpl::lastFrameTimeMonotonic() const |
1124 { | 1091 { |
1125 return m_webView->lastFrameTimeMonotonic(); | 1092 return m_webView->lastFrameTimeMonotonic(); |
1126 } | 1093 } |
1127 | 1094 |
1128 } // namespace blink | 1095 } // namespace blink |
OLD | NEW |