Emit "new-window" event for dispositions other than CURRENT_TAB

This commit is contained in:
Cheng Zhao 2014-11-04 17:59:15 +08:00
parent 77724345c4
commit 013593ccf8
6 changed files with 29 additions and 9 deletions

View file

@ -437,7 +437,8 @@ bool NativeWindow::ShouldCreateWebContents(
observers_,
WillCreatePopupWindow(frame_name,
target_url,
partition_id));
partition_id,
CURRENT_TAB));
return false;
}
@ -448,8 +449,15 @@ bool NativeWindow::ShouldCreateWebContents(
content::WebContents* NativeWindow::OpenURLFromTab(
content::WebContents* source,
const content::OpenURLParams& params) {
if (params.disposition != CURRENT_TAB)
return NULL;
if (params.disposition != CURRENT_TAB) {
FOR_EACH_OBSERVER(NativeWindowObserver,
observers_,
WillCreatePopupWindow(base::string16(),
params.url,
"",
params.disposition));
return NULL;
}
content::NavigationController::LoadURLParams load_url_params(params.url);
load_url_params.referrer = params.referrer;