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 766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
777 NavigationRequest* ongoing_navigation_request = | 777 NavigationRequest* ongoing_navigation_request = |
778 frame_tree_node->navigation_request(); | 778 frame_tree_node->navigation_request(); |
779 | 779 |
780 // The renderer-initiated navigation request is ignored iff a) there is an | 780 // The renderer-initiated navigation request is ignored iff a) there is an |
781 // ongoing request b) which is browser or user-initiated and c) the renderer | 781 // ongoing request b) which is browser or user-initiated and c) the renderer |
782 // request is not user-initiated. | 782 // request is not user-initiated. |
783 if (ongoing_navigation_request && | 783 if (ongoing_navigation_request && |
784 (ongoing_navigation_request->browser_initiated() || | 784 (ongoing_navigation_request->browser_initiated() || |
785 ongoing_navigation_request->begin_params().has_user_gesture) && | 785 ongoing_navigation_request->begin_params().has_user_gesture) && |
786 !begin_params.has_user_gesture) { | 786 !begin_params.has_user_gesture) { |
| 787 RenderFrameHost* current_frame_host = |
| 788 frame_tree_node->render_manager()->current_frame_host(); |
| 789 current_frame_host->Send( |
| 790 new FrameMsg_Stop(current_frame_host->GetRoutingID())); |
787 return; | 791 return; |
788 } | 792 } |
789 | 793 |
790 // In all other cases the current navigation, if any, is canceled and a new | 794 // In all other cases the current navigation, if any, is canceled and a new |
791 // NavigationRequest is created for the node. | 795 // NavigationRequest is created for the node. |
792 frame_tree_node->CreatedNavigationRequest( | 796 frame_tree_node->CreatedNavigationRequest( |
793 NavigationRequest::CreateRendererInitiated( | 797 NavigationRequest::CreateRendererInitiated( |
794 frame_tree_node, common_params, begin_params, body, | 798 frame_tree_node, common_params, begin_params, body, |
795 controller_->GetLastCommittedEntryIndex(), | 799 controller_->GetLastCommittedEntryIndex(), |
796 controller_->GetEntryCount())); | 800 controller_->GetEntryCount())); |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1061 entry->set_should_replace_entry(pending_entry->should_replace_entry()); | 1065 entry->set_should_replace_entry(pending_entry->should_replace_entry()); |
1062 entry->SetRedirectChain(pending_entry->GetRedirectChain()); | 1066 entry->SetRedirectChain(pending_entry->GetRedirectChain()); |
1063 } | 1067 } |
1064 controller_->SetPendingEntry(std::move(entry)); | 1068 controller_->SetPendingEntry(std::move(entry)); |
1065 if (delegate_) | 1069 if (delegate_) |
1066 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); | 1070 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); |
1067 } | 1071 } |
1068 } | 1072 } |
1069 | 1073 |
1070 } // namespace content | 1074 } // namespace content |
OLD | NEW |