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/navigation_controller_impl.h" | 5 #include "content/browser/frame_host/navigation_controller_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
724 } | 724 } |
725 | 725 |
726 NavigationEntryImpl* entry = NavigationEntryImpl::FromNavigationEntry( | 726 NavigationEntryImpl* entry = NavigationEntryImpl::FromNavigationEntry( |
727 CreateNavigationEntry( | 727 CreateNavigationEntry( |
728 params.url, | 728 params.url, |
729 params.referrer, | 729 params.referrer, |
730 params.transition_type, | 730 params.transition_type, |
731 params.is_renderer_initiated, | 731 params.is_renderer_initiated, |
732 params.extra_headers, | 732 params.extra_headers, |
733 browser_context_)); | 733 browser_context_)); |
| 734 if (!params.frame_name.empty()) { |
| 735 // This is only used for navigating subframes in tests. |
| 736 FrameTreeNode* named_frame = |
| 737 delegate_->GetFrameTree()->FindByName(params.frame_name); |
| 738 if (named_frame) |
| 739 entry->set_frame_tree_node_id(named_frame->frame_tree_node_id()); |
| 740 } |
734 if (params.frame_tree_node_id != -1) | 741 if (params.frame_tree_node_id != -1) |
735 entry->set_frame_tree_node_id(params.frame_tree_node_id); | 742 entry->set_frame_tree_node_id(params.frame_tree_node_id); |
736 entry->set_source_site_instance( | 743 entry->set_source_site_instance( |
737 static_cast<SiteInstanceImpl*>(params.source_site_instance.get())); | 744 static_cast<SiteInstanceImpl*>(params.source_site_instance.get())); |
738 if (params.redirect_chain.size() > 0) | 745 if (params.redirect_chain.size() > 0) |
739 entry->SetRedirectChain(params.redirect_chain); | 746 entry->SetRedirectChain(params.redirect_chain); |
740 // Don't allow an entry replacement if there is no entry to replace. | 747 // Don't allow an entry replacement if there is no entry to replace. |
741 // http://crbug.com/457149 | 748 // http://crbug.com/457149 |
742 if (params.should_replace_current_entry && entries_.size() > 0) | 749 if (params.should_replace_current_entry && entries_.size() > 0) |
743 entry->set_should_replace_entry(true); | 750 entry->set_should_replace_entry(true); |
744 entry->set_should_clear_history_list(params.should_clear_history_list); | 751 entry->set_should_clear_history_list(params.should_clear_history_list); |
745 entry->SetIsOverridingUserAgent(override); | 752 entry->SetIsOverridingUserAgent(override); |
746 entry->set_transferred_global_request_id( | 753 entry->set_transferred_global_request_id( |
747 params.transferred_global_request_id); | 754 params.transferred_global_request_id); |
748 entry->SetFrameToNavigate(params.frame_name); | |
749 | 755 |
750 #if defined(OS_ANDROID) | 756 #if defined(OS_ANDROID) |
751 if (params.intent_received_timestamp > 0) { | 757 if (params.intent_received_timestamp > 0) { |
752 entry->set_intent_received_timestamp( | 758 entry->set_intent_received_timestamp( |
753 base::TimeTicks() + | 759 base::TimeTicks() + |
754 base::TimeDelta::FromMilliseconds(params.intent_received_timestamp)); | 760 base::TimeDelta::FromMilliseconds(params.intent_received_timestamp)); |
755 } | 761 } |
756 #endif | 762 #endif |
757 | 763 |
758 switch (params.load_type) { | 764 switch (params.load_type) { |
(...skipping 1095 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1854 } | 1860 } |
1855 } | 1861 } |
1856 } | 1862 } |
1857 | 1863 |
1858 void NavigationControllerImpl::SetGetTimestampCallbackForTest( | 1864 void NavigationControllerImpl::SetGetTimestampCallbackForTest( |
1859 const base::Callback<base::Time()>& get_timestamp_callback) { | 1865 const base::Callback<base::Time()>& get_timestamp_callback) { |
1860 get_timestamp_callback_ = get_timestamp_callback; | 1866 get_timestamp_callback_ = get_timestamp_callback; |
1861 } | 1867 } |
1862 | 1868 |
1863 } // namespace content | 1869 } // namespace content |
OLD | NEW |