From: Cheng Zhao Date: Tue, 17 May 2016 12:50:47 +0000 (+0900) Subject: A normal WebContents can have no owner window X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8a061b7183d170c51a1897e51c42f397584d3c56;p=platform%2Fframework%2Fweb%2Fcrosswalk-tizen.git A normal WebContents can have no owner window --- diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index e3d7c1f2b..6a254ab8b 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -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); }