Skip to content

Commit

Permalink
fix: BrowserView setBackgroundColor needs two calls (#31945)
Browse files Browse the repository at this point in the history
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
  • Loading branch information
trop[bot] and codebytere committed Nov 22, 2021
1 parent 20fc69e commit e4fbf38
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions shell/browser/api/electron_api_browser_view.cc
Expand Up @@ -155,11 +155,12 @@ gfx::Rect BrowserView::GetBounds() {
}

void BrowserView::SetBackgroundColor(const std::string& color_name) {
if (!web_contents())
return;
view_->SetBackgroundColor(ParseHexColor(color_name));

auto* wc = web_contents()->web_contents();
wc->SetPageBaseBackgroundColor(ParseHexColor(color_name));
if (web_contents()) {
auto* wc = web_contents()->web_contents();
wc->SetPageBaseBackgroundColor(ParseHexColor(color_name));
}
}

v8::Local<v8::Value> BrowserView::GetWebContents(v8::Isolate* isolate) {
Expand Down

0 comments on commit e4fbf38

Please sign in to comment.