// WebContents::GetRenderWidgetHostView will return the RWHV of an
// interstitial page if one is showing at this time. We only want opacity
// to apply to web pages.
- if (guest_opaque_) {
- web_contents()
- ->GetRenderViewHost()
- ->GetView()
- ->SetBackgroundColorToDefault();
- } else {
- web_contents()->GetRenderViewHost()->GetView()->SetBackgroundColor(
- SK_ColorTRANSPARENT);
- }
+ auto render_view_host_view = web_contents()->GetRenderViewHost()->GetView();
+ if (guest_opaque_)
+ render_view_host_view->SetBackgroundColorToDefault();
+ else
+ render_view_host_view->SetBackgroundColor(SK_ColorTRANSPARENT);
}
void WebContents::WebContentsDestroyed() {
}
}
+bool WebContents::IsGuest() const {
+ return is_guest();
+}
+
void WebContents::HasServiceWorker(
const base::Callback<void(bool)>& callback) {
auto context = GetServiceWorkerContext(web_contents());
.SetMethod("_send", &WebContents::SendIPCMessage)
.SetMethod("setSize", &WebContents::SetSize)
.SetMethod("setAllowTransparency", &WebContents::SetAllowTransparency)
- .SetMethod("isGuest", &WebContents::is_guest)
+ .SetMethod("isGuest", &WebContents::IsGuest)
.SetMethod("hasServiceWorker", &WebContents::HasServiceWorker)
.SetMethod("unregisterServiceWorker",
&WebContents::UnregisterServiceWorker)
// Sets the transparency of the guest.
void SetAllowTransparency(bool allow);
- // Returns whether this is a guest view.
- bool is_guest() const { return guest_instance_id_ != -1; }
+ bool IsGuest() const;
// Returns whether this guest has an associated embedder.
bool attached() const { return !!embedder_web_contents_; }