Remove duplicate def of is_guest

This commit is contained in:
Cheng Zhao 2015-06-05 15:18:15 +08:00
parent d9efc3b4bf
commit 67144aaf2a
2 changed files with 11 additions and 12 deletions

View file

@ -384,15 +384,11 @@ 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.
if (guest_opaque_) { auto render_view_host_view = web_contents()->GetRenderViewHost()->GetView();
web_contents() if (guest_opaque_)
->GetRenderViewHost() render_view_host_view->SetBackgroundColorToDefault();
->GetView() else
->SetBackgroundColorToDefault(); render_view_host_view->SetBackgroundColor(SK_ColorTRANSPARENT);
} else {
web_contents()->GetRenderViewHost()->GetView()->SetBackgroundColor(
SK_ColorTRANSPARENT);
}
} }
void WebContents::WebContentsDestroyed() { void WebContents::WebContentsDestroyed() {
@ -669,6 +665,10 @@ void WebContents::SetAllowTransparency(bool allow) {
} }
} }
bool WebContents::IsGuest() const {
return is_guest();
}
void WebContents::HasServiceWorker( void WebContents::HasServiceWorker(
const base::Callback<void(bool)>& callback) { const base::Callback<void(bool)>& callback) {
auto context = GetServiceWorkerContext(web_contents()); auto context = GetServiceWorkerContext(web_contents());
@ -740,7 +740,7 @@ mate::ObjectTemplateBuilder WebContents::GetObjectTemplateBuilder(
.SetMethod("_send", &WebContents::SendIPCMessage) .SetMethod("_send", &WebContents::SendIPCMessage)
.SetMethod("setSize", &WebContents::SetSize) .SetMethod("setSize", &WebContents::SetSize)
.SetMethod("setAllowTransparency", &WebContents::SetAllowTransparency) .SetMethod("setAllowTransparency", &WebContents::SetAllowTransparency)
.SetMethod("isGuest", &WebContents::is_guest) .SetMethod("isGuest", &WebContents::IsGuest)
.SetMethod("hasServiceWorker", &WebContents::HasServiceWorker) .SetMethod("hasServiceWorker", &WebContents::HasServiceWorker)
.SetMethod("unregisterServiceWorker", .SetMethod("unregisterServiceWorker",
&WebContents::UnregisterServiceWorker) &WebContents::UnregisterServiceWorker)

View file

@ -108,8 +108,7 @@ class WebContents : public mate::EventEmitter,
// Sets the transparency of the guest. // Sets the transparency of the guest.
void SetAllowTransparency(bool allow); void SetAllowTransparency(bool allow);
// Returns whether this is a guest view. bool IsGuest() const;
bool is_guest() const { return guest_instance_id_ != -1; }
// Returns whether this guest has an associated embedder. // Returns whether this guest has an associated embedder.
bool attached() const { return !!embedder_web_contents_; } bool attached() const { return !!embedder_web_contents_; }