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

Side by Side Diff: content/browser/frame_host/navigation_request.cc

Issue 2352083003: Allow top-level navigation in extension pop-ups if it only triggers a download. (Closed)
Patch Set: Changed bug reference (in a TODO comment) to a fresh bug. Created 4 years, 2 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/frame_host/navigation_request.h" 5 #include "content/browser/frame_host/navigation_request.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "content/browser/devtools/render_frame_devtools_agent_host.h" 9 #include "content/browser/devtools/render_frame_devtools_agent_host.h"
10 #include "content/browser/frame_host/frame_tree.h" 10 #include "content/browser/frame_host/frame_tree.h"
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 // Select an appropriate renderer to commit the navigation. 352 // Select an appropriate renderer to commit the navigation.
353 RenderFrameHostImpl* render_frame_host = 353 RenderFrameHostImpl* render_frame_host =
354 frame_tree_node_->render_manager()->GetFrameHostForNavigation(*this); 354 frame_tree_node_->render_manager()->GetFrameHostForNavigation(*this);
355 NavigatorImpl::CheckWebUIRendererDoesNotDisplayNormalURL(render_frame_host, 355 NavigatorImpl::CheckWebUIRendererDoesNotDisplayNormalURL(render_frame_host,
356 common_params_.url); 356 common_params_.url);
357 357
358 // For renderer-initiated navigations that are set to commit in a different 358 // For renderer-initiated navigations that are set to commit in a different
359 // renderer, allow the embedder to cancel the transfer. 359 // renderer, allow the embedder to cancel the transfer.
360 if (!browser_initiated_ && 360 if (!browser_initiated_ &&
361 render_frame_host != frame_tree_node_->current_frame_host() && 361 render_frame_host != frame_tree_node_->current_frame_host() &&
362 !frame_tree_node_->navigator() 362 !frame_tree_node_->navigator()->GetDelegate()->ShouldTransferNavigation(
363 ->GetDelegate() 363 frame_tree_node_->IsMainFrame())) {
364 ->ShouldTransferNavigation()) {
365 frame_tree_node_->ResetNavigationRequest(false); 364 frame_tree_node_->ResetNavigationRequest(false);
366 return; 365 return;
367 } 366 }
368 367
369 if (navigation_data) 368 if (navigation_data)
370 navigation_handle_->set_navigation_data(std::move(navigation_data)); 369 navigation_handle_->set_navigation_data(std::move(navigation_data));
371 370
372 // Store the response and the StreamHandle until checks have been processed. 371 // Store the response and the StreamHandle until checks have been processed.
373 response_ = response; 372 response_ = response;
374 body_ = std::move(body); 373 body_ = std::move(body);
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 514
516 TransferNavigationHandleOwnership(render_frame_host); 515 TransferNavigationHandleOwnership(render_frame_host);
517 render_frame_host->CommitNavigation(response_.get(), std::move(body_), 516 render_frame_host->CommitNavigation(response_.get(), std::move(body_),
518 common_params_, request_params_, 517 common_params_, request_params_,
519 is_view_source_); 518 is_view_source_);
520 519
521 frame_tree_node_->ResetNavigationRequest(true); 520 frame_tree_node_->ResetNavigationRequest(true);
522 } 521 }
523 522
524 } // namespace content 523 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/cross_site_transfer_browsertest.cc ('k') | content/browser/frame_host/navigator_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698