Chromium Code Reviews| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 640 return GetContentClient()->browser()->ShouldAssignSiteForURL(url); | 640 return GetContentClient()->browser()->ShouldAssignSiteForURL(url); |
| 641 } | 641 } |
| 642 | 642 |
| 643 void NavigatorImpl::RequestOpenURL(RenderFrameHostImpl* render_frame_host, | 643 void NavigatorImpl::RequestOpenURL(RenderFrameHostImpl* render_frame_host, |
| 644 const GURL& url, | 644 const GURL& url, |
| 645 SiteInstance* source_site_instance, | 645 SiteInstance* source_site_instance, |
| 646 const Referrer& referrer, | 646 const Referrer& referrer, |
| 647 WindowOpenDisposition disposition, | 647 WindowOpenDisposition disposition, |
| 648 bool should_replace_current_entry, | 648 bool should_replace_current_entry, |
| 649 bool user_gesture) { | 649 bool user_gesture) { |
| 650 // This call only makes sense for subframes if OOPIFs are possible. | 650 // This call only makes sense for subframes if OOPIFs are possible, or if |
| 651 // FrameNavigationEntries are being used. The latter case happens when the | |
| 652 // history item for a subframe is not found during a history navigation, and | |
| 653 // the subframe needs to navigate to the fallback url. | |
| 651 DCHECK(!render_frame_host->GetParent() || | 654 DCHECK(!render_frame_host->GetParent() || |
| 652 SiteIsolationPolicy::AreCrossProcessFramesPossible()); | 655 SiteIsolationPolicy::AreCrossProcessFramesPossible() || |
| 656 SiteIsolationPolicy::UseSubframeNavigationEntries()); | |
|
Charlie Reis
2016/04/15 17:36:42
nit: This should just be UseSubframeNavigationEntr
clamy
2016/04/25 11:05:34
Removed this block due to code change in navigator
| |
| 653 | 657 |
| 654 SiteInstance* current_site_instance = render_frame_host->frame_tree_node() | 658 SiteInstance* current_site_instance = render_frame_host->frame_tree_node() |
| 655 ->current_frame_host() | 659 ->current_frame_host() |
| 656 ->GetSiteInstance(); | 660 ->GetSiteInstance(); |
| 657 | 661 |
| 658 // TODO(creis): Pass the redirect_chain into this method to support client | 662 // TODO(creis): Pass the redirect_chain into this method to support client |
| 659 // redirects. http://crbug.com/311721. | 663 // redirects. http://crbug.com/311721. |
| 660 std::vector<GURL> redirect_chain; | 664 std::vector<GURL> redirect_chain; |
| 661 | 665 |
| 662 GURL dest_url(url); | 666 GURL dest_url(url); |
| 663 if (!GetContentClient()->browser()->ShouldAllowOpenURL( | 667 if (!GetContentClient()->browser()->ShouldAllowOpenURL( |
| 664 current_site_instance, url)) { | 668 current_site_instance, url)) { |
| 665 dest_url = GURL(url::kAboutBlankURL); | 669 dest_url = GURL(url::kAboutBlankURL); |
| 666 } | 670 } |
| 667 | 671 |
| 668 int frame_tree_node_id = -1; | 672 int frame_tree_node_id = -1; |
| 669 | 673 |
| 670 // Send the navigation to the current FrameTreeNode if it's destined for a | 674 // Send the navigation to the current FrameTreeNode if it's destined for a |
| 671 // subframe in the current tab. We'll assume it's for the main frame | 675 // subframe in the current tab. We'll assume it's for the main frame |
| 672 // (possibly of a new or different WebContents) otherwise. | 676 // (possibly of a new or different WebContents) otherwise. |
| 673 if (SiteIsolationPolicy::AreCrossProcessFramesPossible() && | 677 if ((SiteIsolationPolicy::AreCrossProcessFramesPossible() || |
| 678 SiteIsolationPolicy::UseSubframeNavigationEntries()) && | |
|
Charlie Reis
2016/04/15 17:36:42
Same.
clamy
2016/04/25 11:05:34
Done.
| |
| 674 disposition == CURRENT_TAB && render_frame_host->GetParent()) { | 679 disposition == CURRENT_TAB && render_frame_host->GetParent()) { |
| 675 frame_tree_node_id = | 680 frame_tree_node_id = |
| 676 render_frame_host->frame_tree_node()->frame_tree_node_id(); | 681 render_frame_host->frame_tree_node()->frame_tree_node_id(); |
| 677 } | 682 } |
| 678 | 683 |
| 679 OpenURLParams params(dest_url, referrer, frame_tree_node_id, disposition, | 684 OpenURLParams params(dest_url, referrer, frame_tree_node_id, disposition, |
| 680 ui::PAGE_TRANSITION_LINK, | 685 ui::PAGE_TRANSITION_LINK, |
| 681 true /* is_renderer_initiated */); | 686 true /* is_renderer_initiated */); |
| 682 params.source_site_instance = source_site_instance; | 687 params.source_site_instance = source_site_instance; |
| 683 if (redirect_chain.size() > 0) | 688 if (redirect_chain.size() > 0) |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1100 if (pending_entry != controller_->GetVisibleEntry() || | 1105 if (pending_entry != controller_->GetVisibleEntry() || |
| 1101 !should_preserve_entry) { | 1106 !should_preserve_entry) { |
| 1102 controller_->DiscardPendingEntry(true); | 1107 controller_->DiscardPendingEntry(true); |
| 1103 | 1108 |
| 1104 // Also force the UI to refresh. | 1109 // Also force the UI to refresh. |
| 1105 controller_->delegate()->NotifyNavigationStateChanged(INVALIDATE_TYPE_URL); | 1110 controller_->delegate()->NotifyNavigationStateChanged(INVALIDATE_TYPE_URL); |
| 1106 } | 1111 } |
| 1107 } | 1112 } |
| 1108 | 1113 |
| 1109 } // namespace content | 1114 } // namespace content |
| OLD | NEW |