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 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
755 NavigationRequest* ongoing_navigation_request = | 755 NavigationRequest* ongoing_navigation_request = |
756 frame_tree_node->navigation_request(); | 756 frame_tree_node->navigation_request(); |
757 | 757 |
758 // The renderer-initiated navigation request is ignored iff a) there is an | 758 // The renderer-initiated navigation request is ignored iff a) there is an |
759 // ongoing request b) which is browser or user-initiated and c) the renderer | 759 // ongoing request b) which is browser or user-initiated and c) the renderer |
760 // request is not user-initiated. | 760 // request is not user-initiated. |
761 if (ongoing_navigation_request && | 761 if (ongoing_navigation_request && |
762 (ongoing_navigation_request->browser_initiated() || | 762 (ongoing_navigation_request->browser_initiated() || |
763 ongoing_navigation_request->begin_params().has_user_gesture) && | 763 ongoing_navigation_request->begin_params().has_user_gesture) && |
764 !begin_params.has_user_gesture) { | 764 !begin_params.has_user_gesture) { |
| 765 RenderFrameHost* current_frame_host = |
| 766 frame_tree_node->render_manager()->current_frame_host(); |
| 767 current_frame_host->Send( |
| 768 new FrameMsg_Stop(current_frame_host->GetRoutingID())); |
765 return; | 769 return; |
766 } | 770 } |
767 | 771 |
768 // In all other cases the current navigation, if any, is canceled and a new | 772 // In all other cases the current navigation, if any, is canceled and a new |
769 // NavigationRequest is created for the node. | 773 // NavigationRequest is created for the node. |
770 frame_tree_node->CreatedNavigationRequest( | 774 frame_tree_node->CreatedNavigationRequest( |
771 NavigationRequest::CreateRendererInitiated( | 775 NavigationRequest::CreateRendererInitiated( |
772 frame_tree_node, common_params, begin_params, body, | 776 frame_tree_node, common_params, begin_params, body, |
773 controller_->GetLastCommittedEntryIndex(), | 777 controller_->GetLastCommittedEntryIndex(), |
774 controller_->GetEntryCount())); | 778 controller_->GetEntryCount())); |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1038 entry->set_should_replace_entry(pending_entry->should_replace_entry()); | 1042 entry->set_should_replace_entry(pending_entry->should_replace_entry()); |
1039 entry->SetRedirectChain(pending_entry->GetRedirectChain()); | 1043 entry->SetRedirectChain(pending_entry->GetRedirectChain()); |
1040 } | 1044 } |
1041 controller_->SetPendingEntry(std::move(entry)); | 1045 controller_->SetPendingEntry(std::move(entry)); |
1042 if (delegate_) | 1046 if (delegate_) |
1043 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); | 1047 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); |
1044 } | 1048 } |
1045 } | 1049 } |
1046 | 1050 |
1047 } // namespace content | 1051 } // namespace content |
OLD | NEW |