Merge pull request #11956 from brenca/transparent-window-devtools-fix

Fix transparent windows losing transparency when devtools detaches
This commit is contained in:
Cheng Zhao 2018-02-21 19:54:35 +09:00 committed by GitHub
commit f7ec346e9f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -167,10 +167,8 @@ void RendererClientBase::RenderViewCreated(content::RenderView* render_view) {
if (cmd->HasSwitch(switches::kGuestInstanceID)) { // webview.
web_frame_widget->SetBaseBackgroundColor(SK_ColorTRANSPARENT);
} else { // normal window.
// If backgroundColor is specified then use it.
std::string name = cmd->GetSwitchValueASCII(switches::kBackgroundColor);
// Otherwise use white background.
SkColor color = name.empty() ? SK_ColorWHITE : ParseHexColor(name);
SkColor color = name.empty() ? SK_ColorTRANSPARENT : ParseHexColor(name);
web_frame_widget->SetBaseBackgroundColor(color);
}
}