Chromium Code Reviews| Index: Source/web/WebViewImpl.cpp |
| diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp |
| index dcad19b352389879f734234ca6fe73442cc48d20..e28f414212a7f1f80d64c78910d5d703f142576f 100644 |
| --- a/Source/web/WebViewImpl.cpp |
| +++ b/Source/web/WebViewImpl.cpp |
| @@ -139,7 +139,6 @@ |
| #include "core/platform/chromium/KeyboardCodes.h" |
| #include "core/platform/chromium/TraceEvent.h" |
| #include "core/platform/chromium/support/WebActiveGestureAnimation.h" |
| -#include "core/platform/graphics/Color.h" |
| #include "core/platform/graphics/ColorSpace.h" |
| #include "core/platform/graphics/Extensions3D.h" |
| #include "core/platform/graphics/FontCache.h" |
| @@ -427,6 +426,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client) |
| , m_showDebugBorders(false) |
| , m_continuousPaintingEnabled(false) |
| , m_showScrollBottleneckRects(false) |
| + , m_baseBackgroundColor(Color::white) |
| { |
| Page::PageClients pageClients; |
| pageClients.chromeClient = &m_chromeClientImpl; |
| @@ -2461,11 +2461,11 @@ WebColor WebViewImpl::backgroundColor() const |
| if (isTransparent()) |
| return Color::transparent; |
| if (!m_page) |
| - return Color::white; |
| + return m_baseBackgroundColor.rgb(); |
| FrameView* view = m_page->mainFrame()->view(); |
| StyleColor backgroundColor = view->documentBackgroundColor(); |
| if (!backgroundColor.isValid()) |
| - return Color::white; |
| + return m_baseBackgroundColor.rgb(); |
| return backgroundColor.rgb(); |
| } |
| @@ -3578,6 +3578,20 @@ bool WebViewImpl::isTransparent() const |
| return m_isTransparent; |
| } |
| +void WebViewImpl::setBaseBackgroundColor(WebColor color) |
| +{ |
| + Color c(static_cast<RGBA32>(color)); |
|
jamesr
2013/07/24 23:16:27
avoid one-letter variable names
WebColor and RGBA
|
| + if (m_baseBackgroundColor == c) |
| + return; |
| + |
| + m_baseBackgroundColor = c; |
| + |
| + m_page->mainFrame()->view()->updateBackgroundRecursively(c, m_isTransparent); |
| + |
| + if (m_layerTreeView) |
| + m_layerTreeView->setBackgroundColor(backgroundColor()); |
| +} |
| + |
| void WebViewImpl::setIsActive(bool active) |
| { |
| if (page() && page()->focusController()) |