A normal WebContents can have no owner window

This commit is contained in:
Cheng Zhao 2016-05-17 21:50:47 +09:00
parent 118afab67b
commit 8a061b7183

View file

@ -379,7 +379,7 @@ void WebContents::MoveContents(content::WebContents* source,
void WebContents::CloseContents(content::WebContents* source) {
Emit("close");
if (type_ == BROWSER_WINDOW)
if (type_ == BROWSER_WINDOW && owner_window())
owner_window()->CloseContents(source);
}
@ -430,13 +430,13 @@ void WebContents::ExitFullscreenModeForTab(content::WebContents* source) {
void WebContents::RendererUnresponsive(content::WebContents* source) {
Emit("unresponsive");
if (type_ == BROWSER_WINDOW)
if (type_ == BROWSER_WINDOW && owner_window())
owner_window()->RendererUnresponsive(source);
}
void WebContents::RendererResponsive(content::WebContents* source) {
Emit("responsive");
if (type_ == BROWSER_WINDOW)
if (type_ == BROWSER_WINDOW && owner_window())
owner_window()->RendererResponsive(source);
}