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

Unified Diff: third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp

Issue 1565893004: Sets a transparent background for out-of-process subframes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removing background override Created 4 years, 10 months 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
Index: third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp b/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
index 033a49e59fb956e16f9f9914cd55df6e48e7975b..8c2c3ce044c028b60906d36df583cc33bb5cc898 100644
--- a/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
+++ b/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
@@ -63,7 +63,10 @@ namespace blink {
WebFrameWidget* WebFrameWidget::create(WebWidgetClient* client, WebLocalFrame* localRoot)
{
// Pass the WebFrameWidget's self-reference to the caller.
- return WebFrameWidgetImpl::create(client, localRoot);
+ WebFrameWidgetImpl* widget = WebFrameWidgetImpl::create(client, localRoot);
+ if (localRoot->parent())
dcheng 2016/02/11 22:40:26 Do you think it'd make sense to have this in the c
lfg 2016/02/11 23:48:02 Done.
+ widget->setIsTransparent(true);
+ return widget;
}
WebFrameWidget* WebFrameWidget::create(WebWidgetClient* client, WebView* webView, WebLocalFrame* mainFrame)
@@ -98,6 +101,7 @@ WebFrameWidgetImpl::WebFrameWidgetImpl(WebWidgetClient* client, WebLocalFrame* l
, m_layerTreeViewClosed(false)
, m_suppressNextKeypressEvent(false)
, m_ignoreInputEvents(false)
+ , m_isTransparent(false)
#if ENABLE(OILPAN)
, m_selfKeepAlive(this)
#endif
@@ -278,7 +282,7 @@ void WebFrameWidgetImpl::updateLayerTreeBackgroundColor()
if (!m_layerTreeView)
return;
- m_layerTreeView->setBackgroundColor(alphaChannel(view()->backgroundColorOverride()) ? view()->backgroundColorOverride() : view()->backgroundColor());
+ m_layerTreeView->setBackgroundColor(backgroundColor());
}
void WebFrameWidgetImpl::updateLayerTreeDeviceScaleFactor()
@@ -290,10 +294,17 @@ void WebFrameWidgetImpl::updateLayerTreeDeviceScaleFactor()
m_layerTreeView->setDeviceScaleFactor(deviceScaleFactor);
}
+void WebFrameWidgetImpl::setIsTransparent(bool isTransparent)
+{
+ m_isTransparent = isTransparent;
+
dcheng 2016/02/11 22:40:26 The WebView version also marks the FrameViews as t
lfg 2016/02/11 23:48:02 I believe this is correct. isTransparent() on Fram
dcheng 2016/02/12 22:46:23 Hm... I guess I am thinking that it would make it
+ if (m_layerTreeView)
+ m_layerTreeView->setHasTransparentBackground(isTransparent);
+}
+
bool WebFrameWidgetImpl::isTransparent() const
{
- // FIXME: This might need to proxy to the WebView's isTransparent().
- return false;
+ return m_isTransparent;
}
void WebFrameWidgetImpl::layoutAndPaintAsync(WebLayoutAndPaintAsyncCallback* callback)
@@ -381,6 +392,18 @@ bool WebFrameWidgetImpl::hasTouchEventHandlersAt(const WebPoint& point)
return true;
}
+void WebFrameWidgetImpl::setBaseBackgroundColor(WebColor color)
+{
+ if (m_baseBackgroundColor == color)
+ return;
+
+ m_baseBackgroundColor = color;
+
+ m_localRoot->frameView()->setBaseBackgroundColor(color);
+
+ updateAllLifecyclePhases();
+}
+
void WebFrameWidgetImpl::scheduleAnimation()
{
if (m_layerTreeView) {
@@ -483,7 +506,7 @@ WebColor WebFrameWidgetImpl::backgroundColor() const
if (isTransparent())
return Color::transparent;
if (!m_localRoot->frameView())
- return view()->backgroundColor();
+ return m_baseBackgroundColor;
FrameView* view = m_localRoot->frameView();
return view->documentBackgroundColor().rgb();
}
« no previous file with comments | « third_party/WebKit/Source/web/WebFrameWidgetImpl.h ('k') | third_party/WebKit/Source/web/WebLocalFrameImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698