| Index: content/browser/web_contents/web_contents_impl.cc
|
| ===================================================================
|
| --- content/browser/web_contents/web_contents_impl.cc (revision 153532)
|
| +++ content/browser/web_contents/web_contents_impl.cc (working copy)
|
| @@ -1029,15 +1029,15 @@
|
| return tc;
|
| }
|
|
|
| -void WebContentsImpl::AddNewContents(WebContents* new_contents,
|
| +bool WebContentsImpl::AddNewContents(WebContents* new_contents,
|
| WindowOpenDisposition disposition,
|
| const gfx::Rect& initial_pos,
|
| bool user_gesture) {
|
| if (!delegate_)
|
| - return;
|
| + return false;
|
|
|
| - delegate_->AddNewContents(this, new_contents, disposition, initial_pos,
|
| - user_gesture);
|
| + return delegate_->AddNewContents(
|
| + this, new_contents, disposition, initial_pos, user_gesture);
|
| }
|
|
|
| gfx::NativeView WebContentsImpl::GetContentNativeView() const {
|
| @@ -1275,23 +1275,27 @@
|
| pending_contents_[route_id] = new_contents;
|
| }
|
|
|
| + bool not_blocked = true;
|
| if (delegate_) {
|
| - delegate_->WebContentsCreated(
|
| + not_blocked = delegate_->WebContentsCreated(
|
| this, params.opener_frame_id, params.target_url, new_contents);
|
| }
|
|
|
| - if (params.opener_suppressed) {
|
| + if (params.opener_suppressed && not_blocked) {
|
| // When the opener is suppressed, the original renderer cannot access the
|
| // new window. As a result, we need to show and navigate the window here.
|
| gfx::Rect initial_pos;
|
| - AddNewContents(
|
| + not_blocked = AddNewContents(
|
| new_contents, params.disposition, initial_pos, params.user_gesture);
|
|
|
| - content::OpenURLParams open_params(params.target_url, content::Referrer(),
|
| - CURRENT_TAB,
|
| - content::PAGE_TRANSITION_LINK,
|
| - true /* is_renderer_initiated */);
|
| - new_contents->OpenURL(open_params);
|
| + if (not_blocked) {
|
| + content::OpenURLParams open_params(params.target_url,
|
| + content::Referrer(),
|
| + CURRENT_TAB,
|
| + content::PAGE_TRANSITION_LINK,
|
| + true /* is_renderer_initiated */);
|
| + new_contents->OpenURL(open_params);
|
| + }
|
| }
|
| }
|
|
|
|
|