Chromium Code Reviews| Index: Source/web/ChromeClientImpl.cpp |
| diff --git a/Source/web/ChromeClientImpl.cpp b/Source/web/ChromeClientImpl.cpp |
| index 66c816668cd70f6c9d19b910e1ba5b734260b4f6..3145257819ce2d74ca0d9095652f1aa0feba4693 100644 |
| --- a/Source/web/ChromeClientImpl.cpp |
| +++ b/Source/web/ChromeClientImpl.cpp |
| @@ -92,6 +92,7 @@ |
| #include "web/ExternalPopupMenu.h" |
| #include "web/PopupMenuChromium.h" |
| #include "web/WebFileChooserCompletionImpl.h" |
| +#include "web/WebFrameWidgetImpl.h" |
| #include "web/WebInputEventConversion.h" |
| #include "web/WebLocalFrameImpl.h" |
| #include "web/WebPluginContainerImpl.h" |
| @@ -361,7 +362,7 @@ void ChromeClientImpl::setResizable(bool value) |
| bool ChromeClientImpl::shouldReportDetailedMessageForSource(const String& url) |
| { |
| - WebLocalFrameImpl* webframe = m_webView->localFrameRootTemporary(); |
| + WebLocalFrameImpl* webframe = m_webView->mainFrameImpl(); |
| return webframe->client() && webframe->client()->shouldReportDetailedMessageForSource(url); |
| } |
| @@ -492,8 +493,12 @@ void ChromeClientImpl::scheduleAnimation() |
| void ChromeClientImpl::scheduleAnimationForFrame(LocalFrame* localRoot) |
| { |
| - // FIXME: This will proxy to a WebWidget attached to the WebLocalFrameImpl. |
| - scheduleAnimation(); |
| + ASSERT(WebLocalFrameImpl::fromFrame(localRoot)); |
| + // If the frame is still being created, it might not yet have a WebWidget. |
| + // FIXME: Is this the right thing to do? Is there a way to avoid having |
| + // a local frame root that doesn't have a WebWidget? |
|
dcheng
2014/12/17 23:22:53
Nit: expand this comment that it's OK to do this b
kenrb
2014/12/18 18:46:29
Done.
|
| + if (WebLocalFrameImpl::fromFrame(localRoot)->frameWidget()) |
| + WebLocalFrameImpl::fromFrame(localRoot)->frameWidget()->scheduleAnimation(); |
| } |
| IntRect ChromeClientImpl::rootViewToScreen(const IntRect& rect) const |
| @@ -695,8 +700,21 @@ GraphicsLayerFactory* ChromeClientImpl::graphicsLayerFactory() const |
| void ChromeClientImpl::attachRootGraphicsLayer(GraphicsLayer* rootLayer, LocalFrame* localRoot) |
| { |
| - // FIXME: Add call to frame's widget for non-zero frames. |
| - m_webView->setRootGraphicsLayer(rootLayer); |
| + // 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->setRootGraphicsLayer(rootLayer); |
| + } 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->setRootGraphicsLayer(rootLayer); |
| + return; |
| + } |
| + ASSERT(webFrame && webFrame->frameWidget()); |
| + webFrame->frameWidget()->setRootGraphicsLayer(rootLayer); |
| + } |
| } |
| void ChromeClientImpl::enterFullScreenForElement(Element* element) |