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 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 switches::kEnableBrowserSideNavigation)) { | 497 switches::kEnableBrowserSideNavigation)) { |
498 navigation_request_map_.erase( | 498 navigation_request_map_.erase( |
499 render_frame_host->frame_tree_node()->frame_tree_node_id()); | 499 render_frame_host->frame_tree_node()->frame_tree_node_id()); |
500 } | 500 } |
501 | 501 |
502 FrameHostMsg_DidCommitProvisionalLoad_Params params(input_params); | 502 FrameHostMsg_DidCommitProvisionalLoad_Params params(input_params); |
503 FrameTree* frame_tree = render_frame_host->frame_tree_node()->frame_tree(); | 503 FrameTree* frame_tree = render_frame_host->frame_tree_node()->frame_tree(); |
504 bool use_site_per_process = base::CommandLine::ForCurrentProcess()->HasSwitch( | 504 bool use_site_per_process = base::CommandLine::ForCurrentProcess()->HasSwitch( |
505 switches::kSitePerProcess); | 505 switches::kSitePerProcess); |
506 | 506 |
507 if (use_site_per_process) { | |
508 // TODO(creis): Until we mirror the frame tree in the subframe's process, | |
509 // cross-process subframe navigations happen in a renderer's main frame. | |
510 // Correct the transition type here if we know it is for a subframe. | |
511 NavigationEntryImpl* pending_entry = | |
512 NavigationEntryImpl::FromNavigationEntry( | |
513 controller_->GetPendingEntry()); | |
514 if (!render_frame_host->frame_tree_node()->IsMainFrame() && | |
515 pending_entry && | |
516 pending_entry->frame_tree_node_id() == | |
517 render_frame_host->frame_tree_node()->frame_tree_node_id()) { | |
518 params.transition = ui::PAGE_TRANSITION_AUTO_SUBFRAME; | |
519 } | |
520 } | |
521 | |
522 if (ui::PageTransitionIsMainFrame(params.transition)) { | 507 if (ui::PageTransitionIsMainFrame(params.transition)) { |
523 if (delegate_) { | 508 if (delegate_) { |
524 // When overscroll navigation gesture is enabled, a screenshot of the page | 509 // When overscroll navigation gesture is enabled, a screenshot of the page |
525 // in its current state is taken so that it can be used during the | 510 // in its current state is taken so that it can be used during the |
526 // nav-gesture. It is necessary to take the screenshot here, before | 511 // nav-gesture. It is necessary to take the screenshot here, before |
527 // calling RenderFrameHostManager::DidNavigateMainFrame, because that can | 512 // calling RenderFrameHostManager::DidNavigateMainFrame, because that can |
528 // change WebContents::GetRenderViewHost to return the new host, instead | 513 // change WebContents::GetRenderViewHost to return the new host, instead |
529 // of the one that may have just been swapped out. | 514 // of the one that may have just been swapped out. |
530 if (delegate_->CanOverscrollContent()) { | 515 if (delegate_->CanOverscrollContent()) { |
531 // Don't take screenshots if we are staying on the same page. We want | 516 // Don't take screenshots if we are staying on the same page. We want |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
981 "Navigation.TimeToCommit_ExistingRenderer_BeforeUnloadDiscounted", | 966 "Navigation.TimeToCommit_ExistingRenderer_BeforeUnloadDiscounted", |
982 time_to_commit); | 967 time_to_commit); |
983 UMA_HISTOGRAM_TIMES( | 968 UMA_HISTOGRAM_TIMES( |
984 "Navigation.TimeToURLJobStart_ExistingRenderer_BeforeUnloadDiscounted", | 969 "Navigation.TimeToURLJobStart_ExistingRenderer_BeforeUnloadDiscounted", |
985 time_to_network); | 970 time_to_network); |
986 } | 971 } |
987 navigation_data_.reset(); | 972 navigation_data_.reset(); |
988 } | 973 } |
989 | 974 |
990 } // namespace content | 975 } // namespace content |
OLD | NEW |