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

Unified Diff: Source/web/ChromeClientImpl.cpp

Issue 638003004: Introduce WebFrameWidget to Blink (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: More review updates Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/web/WebFrameWidgetImpl.h » ('j') | Source/web/WebFrameWidgetImpl.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/ChromeClientImpl.cpp
diff --git a/Source/web/ChromeClientImpl.cpp b/Source/web/ChromeClientImpl.cpp
index 080d23627072e3a2a1c9b8e4e8638356c79de991..9617504bff3e243a2b7300da78d38a7399583e61 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.
+ if (!WebLocalFrameImpl::fromFrame(localRoot)->frameWidget())
+ scheduleAnimation();
+ else
+ 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)
« no previous file with comments | « no previous file | Source/web/WebFrameWidgetImpl.h » ('j') | Source/web/WebFrameWidgetImpl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698