decide early on render initiated window creations

This commit is contained in:
deepak1556 2016-03-31 06:28:23 +05:30
parent 7016fbe258
commit e0fe478ae7
6 changed files with 132 additions and 23 deletions

View file

@ -316,23 +316,13 @@ bool WebContents::AddMessageToConsole(content::WebContents* source,
}
}
bool WebContents::ShouldCreateWebContents(
content::WebContents* web_contents,
int32_t route_id,
int32_t main_frame_route_id,
int32_t main_frame_widget_route_id,
WindowContainerType window_container_type,
const std::string& frame_name,
const GURL& target_url,
const std::string& partition_id,
content::SessionStorageNamespace* session_storage_namespace) {
auto disposition = (window_container_type == WINDOW_CONTAINER_TYPE_BACKGROUND)
? "background-tab" : "new-window";
void WebContents::CreateWindow(const GURL& target_url,
const std::string& frame_name,
WindowOpenDisposition disposition) {
if (type_ == BROWSER_WINDOW)
Emit("-new-window", target_url, frame_name, disposition);
else
Emit("new-window", target_url, frame_name, disposition);
return false;
}
content::WebContents* WebContents::OpenURLFromTab(