Fix the API to set opaque background
This commit is contained in:
parent
715ac35672
commit
92142ee372
1 changed files with 16 additions and 8 deletions
|
@ -247,14 +247,14 @@ void WebContents::RenderViewReady() {
|
||||||
// WebContents::GetRenderWidgetHostView will return the RWHV of an
|
// WebContents::GetRenderWidgetHostView will return the RWHV of an
|
||||||
// interstitial page if one is showing at this time. We only want opacity
|
// interstitial page if one is showing at this time. We only want opacity
|
||||||
// to apply to web pages.
|
// to apply to web pages.
|
||||||
web_contents()->GetRenderViewHost()->GetView()->
|
if (guest_opaque_) {
|
||||||
SetBackgroundOpaque(guest_opaque_);
|
web_contents()
|
||||||
|
->GetRenderViewHost()
|
||||||
content::RenderViewHost* rvh = web_contents()->GetRenderViewHost();
|
->GetView()
|
||||||
if (auto_size_enabled_) {
|
->SetBackgroundColorToDefault();
|
||||||
rvh->EnableAutoResize(min_auto_size_, max_auto_size_);
|
|
||||||
} else {
|
} else {
|
||||||
rvh->DisableAutoResize(element_size_);
|
web_contents()->GetRenderViewHost()->GetView()->SetBackgroundColor(
|
||||||
|
SK_ColorTRANSPARENT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -498,7 +498,15 @@ void WebContents::SetAllowTransparency(bool allow) {
|
||||||
if (!web_contents()->GetRenderViewHost()->GetView())
|
if (!web_contents()->GetRenderViewHost()->GetView())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
web_contents()->GetRenderViewHost()->GetView()->SetBackgroundOpaque(!allow);
|
if (guest_opaque_) {
|
||||||
|
web_contents()
|
||||||
|
->GetRenderViewHost()
|
||||||
|
->GetView()
|
||||||
|
->SetBackgroundColorToDefault();
|
||||||
|
} else {
|
||||||
|
web_contents()->GetRenderViewHost()->GetView()->SetBackgroundColor(
|
||||||
|
SK_ColorTRANSPARENT);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mate::ObjectTemplateBuilder WebContents::GetObjectTemplateBuilder(
|
mate::ObjectTemplateBuilder WebContents::GetObjectTemplateBuilder(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue