OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/navigator_impl.h" | 5 #include "content/browser/frame_host/navigator_impl.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
9 #include "content/browser/frame_host/frame_tree.h" | 9 #include "content/browser/frame_host/frame_tree.h" |
10 #include "content/browser/frame_host/frame_tree_node.h" | 10 #include "content/browser/frame_host/frame_tree_node.h" |
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 void NavigatorImpl::RequestOpenURL( | 544 void NavigatorImpl::RequestOpenURL( |
545 RenderFrameHostImpl* render_frame_host, | 545 RenderFrameHostImpl* render_frame_host, |
546 const GURL& url, | 546 const GURL& url, |
547 const Referrer& referrer, | 547 const Referrer& referrer, |
548 WindowOpenDisposition disposition, | 548 WindowOpenDisposition disposition, |
549 bool should_replace_current_entry, | 549 bool should_replace_current_entry, |
550 bool user_gesture) { | 550 bool user_gesture) { |
551 SiteInstance* current_site_instance = | 551 SiteInstance* current_site_instance = |
552 GetRenderManager(render_frame_host)->current_frame_host()-> | 552 GetRenderManager(render_frame_host)->current_frame_host()-> |
553 GetSiteInstance(); | 553 GetSiteInstance(); |
554 // If this came from a swapped out RenderViewHost, we only allow the request | 554 // If this came from a swapped out RenderFrameHost, we only allow the request |
555 // if we are still in the same BrowsingInstance. | 555 // if we are still in the same BrowsingInstance. |
556 if (render_frame_host->render_view_host()->IsSwappedOut() && | 556 // TODO(creis): Move this to RenderFrameProxyHost::OpenURL. |
| 557 if (render_frame_host->is_swapped_out() && |
557 !render_frame_host->GetSiteInstance()->IsRelatedSiteInstance( | 558 !render_frame_host->GetSiteInstance()->IsRelatedSiteInstance( |
558 current_site_instance)) { | 559 current_site_instance)) { |
559 return; | 560 return; |
560 } | 561 } |
561 | 562 |
562 // Delegate to RequestTransferURL because this is just the generic | 563 // Delegate to RequestTransferURL because this is just the generic |
563 // case where |old_request_id| is empty. | 564 // case where |old_request_id| is empty. |
564 // TODO(creis): Pass the redirect_chain into this method to support client | 565 // TODO(creis): Pass the redirect_chain into this method to support client |
565 // redirects. http://crbug.com/311721. | 566 // redirects. http://crbug.com/311721. |
566 std::vector<GURL> redirect_chain; | 567 std::vector<GURL> redirect_chain; |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
653 controller_->GetBrowserContext(), url); | 654 controller_->GetBrowserContext(), url); |
654 if ((enabled_bindings & BINDINGS_POLICY_WEB_UI) && | 655 if ((enabled_bindings & BINDINGS_POLICY_WEB_UI) && |
655 !is_allowed_in_web_ui_renderer) { | 656 !is_allowed_in_web_ui_renderer) { |
656 // Log the URL to help us diagnose any future failures of this CHECK. | 657 // Log the URL to help us diagnose any future failures of this CHECK. |
657 GetContentClient()->SetActiveURL(url); | 658 GetContentClient()->SetActiveURL(url); |
658 CHECK(0); | 659 CHECK(0); |
659 } | 660 } |
660 } | 661 } |
661 | 662 |
662 } // namespace content | 663 } // namespace content |
OLD | NEW |