Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(692)

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 10883031: Change disposition to POPUP for navigations in a new process with no user gesture to trigger popup … (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1271 matching lines...) Expand 10 before | Expand all | Expand 10 after
1282 pending_contents_[route_id] = new_contents; 1282 pending_contents_[route_id] = new_contents;
1283 } 1283 }
1284 1284
1285 if (delegate_) { 1285 if (delegate_) {
1286 delegate_->WebContentsCreated( 1286 delegate_->WebContentsCreated(
1287 this, params.opener_frame_id, params.target_url, new_contents); 1287 this, params.opener_frame_id, params.target_url, new_contents);
1288 } 1288 }
1289 1289
1290 if (params.opener_suppressed) { 1290 if (params.opener_suppressed) {
1291 // When the opener is suppressed, the original renderer cannot access the 1291 // When the opener is suppressed, the original renderer cannot access the
1292 // new window. As a result, we need to show and navigate the window here. 1292 // new window. As a result, we need to show and navigate the window here.
Charlie Reis 2012/08/24 21:30:26 Can you throw in a TODO to ensure we fix whitelist
1293 gfx::Rect initial_pos; 1293 gfx::Rect initial_pos;
1294 AddNewContents( 1294 AddNewContents(
1295 new_contents, params.disposition, initial_pos, params.user_gesture); 1295 new_contents, params.user_gesture ? params.disposition : NEW_POPUP,
1296 initial_pos, params.user_gesture);
1296 1297
1297 content::OpenURLParams open_params(params.target_url, content::Referrer(), 1298 content::OpenURLParams open_params(params.target_url, content::Referrer(),
1298 CURRENT_TAB, 1299 CURRENT_TAB,
1299 content::PAGE_TRANSITION_LINK, 1300 content::PAGE_TRANSITION_LINK,
1300 true /* is_renderer_initiated */); 1301 true /* is_renderer_initiated */);
1301 new_contents->OpenURL(open_params); 1302 new_contents->OpenURL(open_params);
1302 } 1303 }
1303 } 1304 }
1304 1305
1305 void WebContentsImpl::CreateNewWidget(int route_id, 1306 void WebContentsImpl::CreateNewWidget(int route_id,
(...skipping 1905 matching lines...) Expand 10 before | Expand all | Expand 10 after
3211 old_browser_plugin_host()->embedder_render_process_host(); 3212 old_browser_plugin_host()->embedder_render_process_host();
3212 *embedder_container_id = old_browser_plugin_host()->instance_id(); 3213 *embedder_container_id = old_browser_plugin_host()->instance_id();
3213 int embedder_process_id = 3214 int embedder_process_id =
3214 embedder_render_process_host ? embedder_render_process_host->GetID() : -1; 3215 embedder_render_process_host ? embedder_render_process_host->GetID() : -1;
3215 if (embedder_process_id != -1) { 3216 if (embedder_process_id != -1) {
3216 *embedder_channel_name = 3217 *embedder_channel_name =
3217 StringPrintf("%d.r%d", render_view_host->GetProcess()->GetID(), 3218 StringPrintf("%d.r%d", render_view_host->GetProcess()->GetID(),
3218 embedder_process_id); 3219 embedder_process_id);
3219 } 3220 }
3220 } 3221 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698