fix: BrowserView setBackgroundColor needs two calls (#31863)

This commit is contained in:
Shelley Vohr 2021-11-22 01:38:05 +01:00 committed by GitHub
parent 38d2ec0cb6
commit 239ba7d905
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -155,11 +155,12 @@ gfx::Rect BrowserView::GetBounds() {
} }
void BrowserView::SetBackgroundColor(const std::string& color_name) { void BrowserView::SetBackgroundColor(const std::string& color_name) {
if (!web_contents()) view_->SetBackgroundColor(ParseHexColor(color_name));
return;
auto* wc = web_contents()->web_contents(); if (web_contents()) {
wc->SetPageBaseBackgroundColor(ParseHexColor(color_name)); auto* wc = web_contents()->web_contents();
wc->SetPageBaseBackgroundColor(ParseHexColor(color_name));
}
} }
v8::Local<v8::Value> BrowserView::GetWebContents(v8::Isolate* isolate) { v8::Local<v8::Value> BrowserView::GetWebContents(v8::Isolate* isolate) {