Chromium Code Reviews| 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 768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 779 WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(obj->getDocument( )->axObjectCacheOwner().frame()); | 779 WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(obj->getDocument( )->axObjectCacheOwner().frame()); |
| 780 if (webframe && webframe->client()) | 780 if (webframe && webframe->client()) |
| 781 webframe->client()->postAccessibilityEvent(WebAXObject(obj), toWebAXEven t(notification)); | 781 webframe->client()->postAccessibilityEvent(WebAXObject(obj), toWebAXEven t(notification)); |
| 782 } | 782 } |
| 783 | 783 |
| 784 String ChromeClientImpl::acceptLanguages() | 784 String ChromeClientImpl::acceptLanguages() |
| 785 { | 785 { |
| 786 return m_webView->client()->acceptLanguages(); | 786 return m_webView->client()->acceptLanguages(); |
| 787 } | 787 } |
| 788 | 788 |
| 789 void ChromeClientImpl::attachRootGraphicsLayer(GraphicsLayer* rootLayer, LocalFr ame* localRoot) | 789 void ChromeClientImpl::attachRootGraphicsLayer(GraphicsLayer* rootLayer, LocalFr ame* localFrame) |
| 790 { | 790 { |
| 791 // FIXME: For top-level frames we still use the WebView as a WebWidget. This | 791 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(localFrame)->loca lRoot(); |
| 792 // special case will be removed when top-level frames get WebFrameWidgets. | 792 DCHECK(webFrame->frameWidget() || !rootLayer); |
|
dcheng
2016/06/08 00:10:17
Why is it OK for rootLayer to be null in this case
lfg
2016/06/08 21:09:47
We call PaintLayerCompositor::detachRootLayer() in
dcheng
2016/06/09 04:43:51
That doesn't sound right: we should be calling Doc
| |
| 793 if (localRoot->isMainFrame()) { | 793 if (webFrame->frameWidget()) |
| 794 m_webView->setRootGraphicsLayer(rootLayer); | 794 webFrame->frameWidget()->setRootGraphicsLayer(rootLayer); |
| 795 } else { | |
| 796 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(localRoot); | |
| 797 // FIXME: The following conditional is only needed for staging until the | |
| 798 // Chromium patch lands that instantiates a WebFrameWidget. | |
| 799 if (!webFrame->frameWidget()) { | |
| 800 m_webView->setRootGraphicsLayer(rootLayer); | |
| 801 return; | |
| 802 } | |
| 803 DCHECK(webFrame); | |
| 804 DCHECK(webFrame->frameWidget()); | |
| 805 toWebFrameWidgetImpl(webFrame->frameWidget())->setRootGraphicsLayer(root Layer); | |
| 806 } | |
| 807 } | 795 } |
| 808 | 796 |
| 809 void ChromeClientImpl::didPaint(const PaintArtifact& paintArtifact) | 797 void ChromeClientImpl::didPaint(const PaintArtifact& paintArtifact) |
| 810 { | 798 { |
| 811 // TODO(jbroman): This doesn't handle OOPIF correctly. We probably need a | 799 // TODO(jbroman): This doesn't handle OOPIF correctly. We probably need a |
| 812 // branch for WebFrameWidget, like attachRootGraphicsLayer. | 800 // branch for WebFrameWidget, like attachRootGraphicsLayer. |
| 813 m_webView->getPaintArtifactCompositor().update(paintArtifact); | 801 m_webView->getPaintArtifactCompositor().update(paintArtifact); |
| 814 } | 802 } |
| 815 | 803 |
| 816 void ChromeClientImpl::attachCompositorAnimationTimeline(CompositorAnimationTime line* compositorTimeline, LocalFrame* localRoot) | 804 void ChromeClientImpl::attachCompositorAnimationTimeline(CompositorAnimationTime line* compositorTimeline, LocalFrame* localFrame) |
| 817 { | 805 { |
| 818 // FIXME: For top-level frames we still use the WebView as a WebWidget. This | 806 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(localFrame)->loca lRoot(); |
| 819 // special case will be removed when top-level frames get WebFrameWidgets. | 807 webFrame->frameWidget()->attachCompositorAnimationTimeline(compositorTimelin e); |
| 820 if (localRoot->isMainFrame()) { | |
| 821 m_webView->attachCompositorAnimationTimeline(compositorTimeline); | |
| 822 } else { | |
| 823 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(localRoot); | |
| 824 // FIXME: The following conditional is only needed for staging until the | |
| 825 // Chromium patch lands that instantiates a WebFrameWidget. | |
| 826 if (!webFrame->frameWidget()) { | |
| 827 m_webView->attachCompositorAnimationTimeline(compositorTimeline); | |
| 828 return; | |
| 829 } | |
| 830 DCHECK(webFrame); | |
| 831 DCHECK(webFrame->frameWidget()); | |
| 832 toWebFrameWidgetImpl(webFrame->frameWidget())->attachCompositorAnimation Timeline(compositorTimeline); | |
| 833 } | |
| 834 } | 808 } |
| 835 | 809 |
| 836 void ChromeClientImpl::detachCompositorAnimationTimeline(CompositorAnimationTime line* compositorTimeline, LocalFrame* localRoot) | 810 void ChromeClientImpl::detachCompositorAnimationTimeline(CompositorAnimationTime line* compositorTimeline, LocalFrame* localFrame) |
| 837 { | 811 { |
| 838 // FIXME: For top-level frames we still use the WebView as a WebWidget. This | 812 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(localFrame)->loca lRoot(); |
| 839 // special case will be removed when top-level frames get WebFrameWidgets. | 813 if (webFrame->frameWidget()) |
|
dcheng
2016/06/09 04:43:51
Similar comment to the attachRootGraphicsLayer com
| |
| 840 if (localRoot->isMainFrame()) { | 814 webFrame->frameWidget()->detachCompositorAnimationTimeline(compositorTim eline); |
| 841 m_webView->detachCompositorAnimationTimeline(compositorTimeline); | |
| 842 } else { | |
| 843 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(localRoot); | |
| 844 // FIXME: The following conditional is only needed for staging until the | |
| 845 // Chromium patch lands that instantiates a WebFrameWidget. | |
| 846 if (!webFrame->frameWidget()) { | |
| 847 m_webView->detachCompositorAnimationTimeline(compositorTimeline); | |
| 848 return; | |
| 849 } | |
| 850 DCHECK(webFrame); | |
| 851 DCHECK(webFrame->frameWidget()); | |
| 852 toWebFrameWidgetImpl(webFrame->frameWidget())->detachCompositorAnimation Timeline(compositorTimeline); | |
| 853 } | |
| 854 } | 815 } |
| 855 | 816 |
| 856 void ChromeClientImpl::enterFullScreenForElement(Element* element) | 817 void ChromeClientImpl::enterFullScreenForElement(Element* element) |
| 857 { | 818 { |
| 858 m_webView->enterFullScreenForElement(element); | 819 m_webView->enterFullScreenForElement(element); |
| 859 } | 820 } |
| 860 | 821 |
| 861 void ChromeClientImpl::exitFullScreenForElement(Element* element) | 822 void ChromeClientImpl::exitFullScreenForElement(Element* element) |
| 862 { | 823 { |
| 863 m_webView->exitFullScreenForElement(element); | 824 m_webView->exitFullScreenForElement(element); |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1115 { | 1076 { |
| 1116 return adoptPtr(m_webView->scheduler()->createFrameScheduler(blameContext).r elease()); | 1077 return adoptPtr(m_webView->scheduler()->createFrameScheduler(blameContext).r elease()); |
| 1117 } | 1078 } |
| 1118 | 1079 |
| 1119 double ChromeClientImpl::lastFrameTimeMonotonic() const | 1080 double ChromeClientImpl::lastFrameTimeMonotonic() const |
| 1120 { | 1081 { |
| 1121 return m_webView->lastFrameTimeMonotonic(); | 1082 return m_webView->lastFrameTimeMonotonic(); |
| 1122 } | 1083 } |
| 1123 | 1084 |
| 1124 } // namespace blink | 1085 } // namespace blink |
| OLD | NEW |