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

Side by Side Diff: chrome/browser/ui/browser_navigator.cc

Issue 2206963002: Plumb the frame name through the popup blocker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
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 "chrome/browser/ui/browser_navigator.h" 5 #include "chrome/browser/ui/browser_navigator.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 248
249 return params->initiating_profile; 249 return params->initiating_profile;
250 } 250 }
251 251
252 void LoadURLInContents(WebContents* target_contents, 252 void LoadURLInContents(WebContents* target_contents,
253 const GURL& url, 253 const GURL& url,
254 chrome::NavigateParams* params) { 254 chrome::NavigateParams* params) {
255 NavigationController::LoadURLParams load_url_params(url); 255 NavigationController::LoadURLParams load_url_params(url);
256 load_url_params.source_site_instance = params->source_site_instance; 256 load_url_params.source_site_instance = params->source_site_instance;
257 load_url_params.referrer = params->referrer; 257 load_url_params.referrer = params->referrer;
258 load_url_params.frame_name = params->frame_name;
258 load_url_params.frame_tree_node_id = params->frame_tree_node_id; 259 load_url_params.frame_tree_node_id = params->frame_tree_node_id;
259 load_url_params.redirect_chain = params->redirect_chain; 260 load_url_params.redirect_chain = params->redirect_chain;
260 load_url_params.transition_type = params->transition; 261 load_url_params.transition_type = params->transition;
261 load_url_params.extra_headers = params->extra_headers; 262 load_url_params.extra_headers = params->extra_headers;
262 load_url_params.should_replace_current_entry = 263 load_url_params.should_replace_current_entry =
263 params->should_replace_current_entry; 264 params->should_replace_current_entry;
264 load_url_params.is_renderer_initiated = params->is_renderer_initiated; 265 load_url_params.is_renderer_initiated = params->is_renderer_initiated;
265 266
266 if (params->uses_post) { 267 if (params->uses_post) {
267 load_url_params.load_type = NavigationController::LOAD_TYPE_HTTP_POST; 268 load_url_params.load_type = NavigationController::LOAD_TYPE_HTTP_POST;
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 DISALLOW_COPY_AND_ASSIGN(ScopedTargetContentsOwner); 332 DISALLOW_COPY_AND_ASSIGN(ScopedTargetContentsOwner);
332 }; 333 };
333 334
334 content::WebContents* CreateTargetContents(const chrome::NavigateParams& params, 335 content::WebContents* CreateTargetContents(const chrome::NavigateParams& params,
335 const GURL& url) { 336 const GURL& url) {
336 WebContents::CreateParams create_params( 337 WebContents::CreateParams create_params(
337 params.browser->profile(), 338 params.browser->profile(),
338 params.source_site_instance 339 params.source_site_instance
339 ? params.source_site_instance 340 ? params.source_site_instance
340 : tab_util::GetSiteInstanceForNewTab(params.browser->profile(), url)); 341 : tab_util::GetSiteInstanceForNewTab(params.browser->profile(), url));
342 create_params.main_frame_name = params.frame_name;
341 if (params.source_contents) { 343 if (params.source_contents) {
342 create_params.initial_size = 344 create_params.initial_size =
343 params.source_contents->GetContainerBounds().size(); 345 params.source_contents->GetContainerBounds().size();
344 create_params.created_with_opener = params.created_with_opener; 346 create_params.created_with_opener = params.created_with_opener;
345 } 347 }
346 if (params.disposition == NEW_BACKGROUND_TAB) 348 if (params.disposition == NEW_BACKGROUND_TAB)
347 create_params.initially_hidden = true; 349 create_params.initially_hidden = true;
348 350
349 #if defined(USE_AURA) 351 #if defined(USE_AURA)
350 if (params.browser->window() && 352 if (params.browser->window() &&
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 bool reverse_on_redirect = false; 651 bool reverse_on_redirect = false;
650 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( 652 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary(
651 &rewritten_url, browser_context, &reverse_on_redirect); 653 &rewritten_url, browser_context, &reverse_on_redirect);
652 654
653 // Some URLs are mapped to uber subpages. Do not allow them in incognito. 655 // Some URLs are mapped to uber subpages. Do not allow them in incognito.
654 return !(rewritten_url.scheme() == content::kChromeUIScheme && 656 return !(rewritten_url.scheme() == content::kChromeUIScheme &&
655 rewritten_url.host() == chrome::kChromeUIUberHost); 657 rewritten_url.host() == chrome::kChromeUIUberHost);
656 } 658 }
657 659
658 } // namespace chrome 660 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc ('k') | chrome/browser/ui/browser_navigator_params.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698