| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 1266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1277 | 1277 |
| 1278 if (delegate_) { | 1278 if (delegate_) { |
| 1279 delegate_->WebContentsCreated( | 1279 delegate_->WebContentsCreated( |
| 1280 this, params.opener_frame_id, params.target_url, new_contents); | 1280 this, params.opener_frame_id, params.target_url, new_contents); |
| 1281 } | 1281 } |
| 1282 | 1282 |
| 1283 if (params.opener_suppressed) { | 1283 if (params.opener_suppressed) { |
| 1284 // When the opener is suppressed, the original renderer cannot access the | 1284 // When the opener is suppressed, the original renderer cannot access the |
| 1285 // new window. As a result, we need to show and navigate the window here. | 1285 // new window. As a result, we need to show and navigate the window here. |
| 1286 gfx::Rect initial_pos; | 1286 gfx::Rect initial_pos; |
| 1287 // TODO(cdn) Fix popup white-listing for links that open in a new process. |
| 1287 AddNewContents( | 1288 AddNewContents( |
| 1288 new_contents, params.disposition, initial_pos, params.user_gesture); | 1289 new_contents, params.user_gesture ? params.disposition : NEW_POPUP, |
| 1290 initial_pos, params.user_gesture); |
| 1289 | 1291 |
| 1290 content::OpenURLParams open_params(params.target_url, content::Referrer(), | 1292 content::OpenURLParams open_params(params.target_url, content::Referrer(), |
| 1291 CURRENT_TAB, | 1293 CURRENT_TAB, |
| 1292 content::PAGE_TRANSITION_LINK, | 1294 content::PAGE_TRANSITION_LINK, |
| 1293 true /* is_renderer_initiated */); | 1295 true /* is_renderer_initiated */); |
| 1294 new_contents->OpenURL(open_params); | 1296 new_contents->OpenURL(open_params); |
| 1295 } | 1297 } |
| 1296 } | 1298 } |
| 1297 | 1299 |
| 1298 void WebContentsImpl::CreateNewWidget(int route_id, | 1300 void WebContentsImpl::CreateNewWidget(int route_id, |
| (...skipping 1932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3231 old_browser_plugin_host()->embedder_render_process_host(); | 3233 old_browser_plugin_host()->embedder_render_process_host(); |
| 3232 *embedder_container_id = old_browser_plugin_host()->instance_id(); | 3234 *embedder_container_id = old_browser_plugin_host()->instance_id(); |
| 3233 int embedder_process_id = | 3235 int embedder_process_id = |
| 3234 embedder_render_process_host ? embedder_render_process_host->GetID() : -1; | 3236 embedder_render_process_host ? embedder_render_process_host->GetID() : -1; |
| 3235 if (embedder_process_id != -1) { | 3237 if (embedder_process_id != -1) { |
| 3236 *embedder_channel_name = | 3238 *embedder_channel_name = |
| 3237 StringPrintf("%d.r%d", render_view_host->GetProcess()->GetID(), | 3239 StringPrintf("%d.r%d", render_view_host->GetProcess()->GetID(), |
| 3238 embedder_process_id); | 3240 embedder_process_id); |
| 3239 } | 3241 } |
| 3240 } | 3242 } |
| OLD | NEW |