| 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/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "content/browser/frame_host/frame_tree.h" | 10 #include "content/browser/frame_host/frame_tree.h" |
| (...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 GURL dest_url(url); | 613 GURL dest_url(url); |
| 614 SiteInstance* current_site_instance = | 614 SiteInstance* current_site_instance = |
| 615 GetRenderManager(render_frame_host)->current_frame_host()-> | 615 GetRenderManager(render_frame_host)->current_frame_host()-> |
| 616 GetSiteInstance(); | 616 GetSiteInstance(); |
| 617 if (!GetContentClient()->browser()->ShouldAllowOpenURL( | 617 if (!GetContentClient()->browser()->ShouldAllowOpenURL( |
| 618 current_site_instance, url)) { | 618 current_site_instance, url)) { |
| 619 dest_url = GURL(url::kAboutBlankURL); | 619 dest_url = GURL(url::kAboutBlankURL); |
| 620 } | 620 } |
| 621 | 621 |
| 622 int64 frame_tree_node_id = -1; | 622 int64 frame_tree_node_id = -1; |
| 623 |
| 624 // Send the navigation to the current FrameTreeNode if it's destined for a |
| 625 // subframe in the current tab. We'll assume it's for the main frame |
| 626 // (possibly of a new or different WebContents) otherwise. |
| 623 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 627 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 624 switches::kSitePerProcess)) { | 628 switches::kSitePerProcess) && |
| 629 disposition == CURRENT_TAB && |
| 630 render_frame_host->GetParent()) { |
| 625 frame_tree_node_id = | 631 frame_tree_node_id = |
| 626 render_frame_host->frame_tree_node()->frame_tree_node_id(); | 632 render_frame_host->frame_tree_node()->frame_tree_node_id(); |
| 627 } | 633 } |
| 634 |
| 628 OpenURLParams params( | 635 OpenURLParams params( |
| 629 dest_url, referrer, frame_tree_node_id, disposition, page_transition, | 636 dest_url, referrer, frame_tree_node_id, disposition, page_transition, |
| 630 true /* is_renderer_initiated */); | 637 true /* is_renderer_initiated */); |
| 631 params.source_site_instance = source_site_instance; | 638 params.source_site_instance = source_site_instance; |
| 632 if (redirect_chain.size() > 0) | 639 if (redirect_chain.size() > 0) |
| 633 params.redirect_chain = redirect_chain; | 640 params.redirect_chain = redirect_chain; |
| 634 params.transferred_global_request_id = transferred_global_request_id; | 641 params.transferred_global_request_id = transferred_global_request_id; |
| 635 params.should_replace_current_entry = should_replace_current_entry; | 642 params.should_replace_current_entry = should_replace_current_entry; |
| 636 params.user_gesture = user_gesture; | 643 params.user_gesture = user_gesture; |
| 637 | 644 |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 921 "Navigation.TimeToCommit_ExistingRenderer_BeforeUnloadDiscounted", | 928 "Navigation.TimeToCommit_ExistingRenderer_BeforeUnloadDiscounted", |
| 922 time_to_commit); | 929 time_to_commit); |
| 923 UMA_HISTOGRAM_TIMES( | 930 UMA_HISTOGRAM_TIMES( |
| 924 "Navigation.TimeToURLJobStart_ExistingRenderer_BeforeUnloadDiscounted", | 931 "Navigation.TimeToURLJobStart_ExistingRenderer_BeforeUnloadDiscounted", |
| 925 time_to_network); | 932 time_to_network); |
| 926 } | 933 } |
| 927 navigation_data_.reset(); | 934 navigation_data_.reset(); |
| 928 } | 935 } |
| 929 | 936 |
| 930 } // namespace content | 937 } // namespace content |
| OLD | NEW |