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 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 DCHECK(webFrame->frameWidget() || !rootLayer); |
| 795 if (localRoot->isMainFrame()) { | 795 if (webFrame->frameWidget()) |
|
dcheng
2016/07/04 07:34:36
Please add a comment why this method and the metho
lfg
2016/07/04 17:46:12
Done.
| |
| 796 m_webView->setRootGraphicsLayer(rootLayer); | 796 webFrame->frameWidget()->setRootGraphicsLayer(rootLayer); |
| 797 } else { | |
| 798 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(localRoot); | |
| 799 // FIXME: The following conditional is only needed for staging until the | |
| 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 } | 797 } |
| 810 | 798 |
| 811 void ChromeClientImpl::didPaint(const PaintArtifact& paintArtifact) | 799 void ChromeClientImpl::didPaint(const PaintArtifact& paintArtifact) |
| 812 { | 800 { |
| 813 // TODO(jbroman): This doesn't handle OOPIF correctly. We probably need a | 801 // TODO(jbroman): This doesn't handle OOPIF correctly. We probably need a |
| 814 // branch for WebFrameWidget, like attachRootGraphicsLayer. | 802 // branch for WebFrameWidget, like attachRootGraphicsLayer. |
| 815 m_webView->getPaintArtifactCompositor().update(paintArtifact); | 803 m_webView->getPaintArtifactCompositor().update(paintArtifact); |
| 816 } | 804 } |
| 817 | 805 |
| 818 void ChromeClientImpl::attachCompositorAnimationTimeline(CompositorAnimationTime line* compositorTimeline, LocalFrame* localRoot) | 806 void ChromeClientImpl::attachCompositorAnimationTimeline(CompositorAnimationTime line* compositorTimeline, LocalFrame* localFrame) |
| 819 { | 807 { |
| 820 // FIXME: For top-level frames we still use the WebView as a WebWidget. This | 808 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(localFrame)->loca lRoot(); |
| 821 // special case will be removed when top-level frames get WebFrameWidgets. | 809 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 } | 810 } |
| 837 | 811 |
| 838 void ChromeClientImpl::detachCompositorAnimationTimeline(CompositorAnimationTime line* compositorTimeline, LocalFrame* localRoot) | 812 void ChromeClientImpl::detachCompositorAnimationTimeline(CompositorAnimationTime line* compositorTimeline, LocalFrame* localFrame) |
| 839 { | 813 { |
| 840 // FIXME: For top-level frames we still use the WebView as a WebWidget. This | 814 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(localFrame)->loca lRoot(); |
| 841 // special case will be removed when top-level frames get WebFrameWidgets. | 815 if (webFrame->frameWidget()) |
| 842 if (localRoot->isMainFrame()) { | 816 webFrame->frameWidget()->detachCompositorAnimationTimeline(compositorTim eline); |
| 843 m_webView->detachCompositorAnimationTimeline(compositorTimeline); | |
| 844 } else { | |
| 845 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(localRoot); | |
| 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 } | 817 } |
| 857 | 818 |
| 858 void ChromeClientImpl::enterFullScreenForElement(Element* element) | 819 void ChromeClientImpl::enterFullScreenForElement(Element* element) |
| 859 { | 820 { |
| 860 m_webView->enterFullScreenForElement(element); | 821 m_webView->enterFullScreenForElement(element); |
| 861 } | 822 } |
| 862 | 823 |
| 863 void ChromeClientImpl::exitFullScreenForElement(Element* element) | 824 void ChromeClientImpl::exitFullScreenForElement(Element* element) |
| 864 { | 825 { |
| 865 m_webView->exitFullScreenForElement(element); | 826 m_webView->exitFullScreenForElement(element); |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1119 { | 1080 { |
| 1120 return wrapUnique(m_webView->scheduler()->createFrameScheduler(blameContext) .release()); | 1081 return wrapUnique(m_webView->scheduler()->createFrameScheduler(blameContext) .release()); |
| 1121 } | 1082 } |
| 1122 | 1083 |
| 1123 double ChromeClientImpl::lastFrameTimeMonotonic() const | 1084 double ChromeClientImpl::lastFrameTimeMonotonic() const |
| 1124 { | 1085 { |
| 1125 return m_webView->lastFrameTimeMonotonic(); | 1086 return m_webView->lastFrameTimeMonotonic(); |
| 1126 } | 1087 } |
| 1127 | 1088 |
| 1128 } // namespace blink | 1089 } // namespace blink |
| OLD | NEW |