Clean up SetAllowTransparency
This commit is contained in:
parent
52789ab96f
commit
2d65c3bcd0
1 changed files with 4 additions and 7 deletions
|
@ -745,18 +745,15 @@ void WebContents::SetAllowTransparency(bool allow) {
|
||||||
if (guest_opaque_ != allow)
|
if (guest_opaque_ != allow)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
auto render_view_host = web_contents()->GetRenderViewHost();
|
||||||
guest_opaque_ = !allow;
|
guest_opaque_ = !allow;
|
||||||
if (!web_contents()->GetRenderViewHost()->GetView())
|
if (!render_view_host->GetView())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (guest_opaque_) {
|
if (guest_opaque_) {
|
||||||
web_contents()
|
render_view_host->GetView()->SetBackgroundColorToDefault();
|
||||||
->GetRenderViewHost()
|
|
||||||
->GetView()
|
|
||||||
->SetBackgroundColorToDefault();
|
|
||||||
} else {
|
} else {
|
||||||
web_contents()->GetRenderViewHost()->GetView()->SetBackgroundColor(
|
render_view_host->GetView()->SetBackgroundColor(SK_ColorTRANSPARENT);
|
||||||
SK_ColorTRANSPARENT);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue