Chromium Code Reviews| Index: third_party/WebKit/Source/web/WebViewImpl.cpp |
| diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp |
| index 5aefab4a47c2325a1980e994e7dad4e50bb1b936..8725dba24f218526c15ece8a7117e7de329be5f0 100644 |
| --- a/third_party/WebKit/Source/web/WebViewImpl.cpp |
| +++ b/third_party/WebKit/Source/web/WebViewImpl.cpp |
| @@ -373,6 +373,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client, |
| m_flingSourceDevice(WebGestureDeviceUninitialized), |
| m_fullscreenController(FullscreenController::create(this)), |
| m_baseBackgroundColor(Color::white), |
| + m_baseBackgroundColorOverride(Color::transparent), |
| m_backgroundColorOverride(Color::transparent), |
| m_zoomFactorOverride(0), |
| m_userGestureObserved(false), |
| @@ -3572,12 +3573,29 @@ WebInputMethodControllerImpl* WebViewImpl::getActiveWebInputMethodController() |
| return WebInputMethodControllerImpl::fromFrame(focusedLocalFrameInWidget()); |
| } |
| +Color WebViewImpl::baseBackgroundColor() const { |
| + return alphaChannel(m_baseBackgroundColorOverride) |
| + ? m_baseBackgroundColorOverride |
| + : m_baseBackgroundColor; |
| +} |
| + |
| void WebViewImpl::setBaseBackgroundColor(WebColor color) { |
| if (m_baseBackgroundColor == color) |
| return; |
| m_baseBackgroundColor = color; |
| + updateBaseBackgroundColor(); |
| +} |
| + |
| +void WebViewImpl::setBaseBackgroundColorOverride(WebColor color) { |
| + m_baseBackgroundColorOverride = color; |
| + updateBaseBackgroundColor(); |
| +} |
| +void WebViewImpl::updateBaseBackgroundColor() { |
| + WebColor color = alphaChannel(m_baseBackgroundColorOverride) |
|
dgozman
2017/01/26 00:04:17
Use baseBackgroundColor().
Eric Seckler
2017/02/06 23:54:37
Done.
|
| + ? m_baseBackgroundColorOverride |
| + : m_baseBackgroundColor; |
| if (m_page->mainFrame() && m_page->mainFrame()->isLocalFrame()) |
| m_page->deprecatedLocalMainFrame()->view()->setBaseBackgroundColor(color); |
| } |