feat: support more color formats for backgroundColor (#31868)

This commit is contained in:
Shelley Vohr 2022-03-21 18:35:54 +01:00 committed by GitHub
parent 4b8b492b62
commit db79734bfb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 144 additions and 55 deletions

View file

@ -154,11 +154,11 @@ gfx::Rect BrowserView::GetBounds() {
}
void BrowserView::SetBackgroundColor(const std::string& color_name) {
view_->SetBackgroundColor(ParseHexColor(color_name));
view_->SetBackgroundColor(ParseCSSColor(color_name));
if (web_contents()) {
auto* wc = web_contents()->web_contents();
wc->SetPageBaseBackgroundColor(ParseHexColor(color_name));
wc->SetPageBaseBackgroundColor(ParseCSSColor(color_name));
}
}