Destroy web contents when preventing default

This commit is contained in:
Kevin Sawicki 2017-01-10 15:40:07 -08:00
parent c5da330cdf
commit 8f63fdb278

View file

@ -419,9 +419,11 @@ void WebContents::AddNewContents(content::WebContents* source,
v8::Locker locker(isolate()); v8::Locker locker(isolate());
v8::HandleScope handle_scope(isolate()); v8::HandleScope handle_scope(isolate());
auto api_web_contents = CreateFrom(isolate(), new_contents); auto api_web_contents = CreateFrom(isolate(), new_contents);
Emit("-add-new-contents", api_web_contents, disposition, user_gesture, if (Emit("-add-new-contents", api_web_contents, disposition, user_gesture,
initial_rect.x(), initial_rect.y(), initial_rect.width(), initial_rect.x(), initial_rect.y(), initial_rect.width(),
initial_rect.height()); initial_rect.height())) {
api_web_contents->DestroyWebContents();
}
} }
content::WebContents* WebContents::OpenURLFromTab( content::WebContents* WebContents::OpenURLFromTab(