From 2d560678195755497bea5745b34331912b5e83a9 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 24 Oct 2014 22:14:12 +0800 Subject: [PATCH] Fix creating window in --- atom/browser/api/atom_api_web_contents.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index caddb2b3..c221a285 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -170,7 +170,14 @@ void WebContents::WillAttach(content::WebContents* embedder_web_contents, content::WebContents* WebContents::CreateNewGuestWindow( const content::WebContents::CreateParams& create_params) { - return nullptr; + auto web_contents = content::WebContents::Create(create_params); + // TODO Currently we just retain the web_contents on V8's heap, which will be + // garbage collected later, we should provide a way to let users make use of + // this WebContents. + mate::Handle managed = CreateFrom( + v8::Isolate::GetCurrent(), web_contents); + managed->storage_.reset(web_contents); + return web_contents; } void WebContents::DidAttach() { -- 2.43.0