| 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 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 if (!dest_render_frame_host) | 313 if (!dest_render_frame_host) |
| 314 return false; // Unable to create the desired RenderFrameHost. | 314 return false; // Unable to create the desired RenderFrameHost. |
| 315 | 315 |
| 316 // Make sure no code called via RFHM::Navigate clears the pending entry. | 316 // Make sure no code called via RFHM::Navigate clears the pending entry. |
| 317 CHECK_EQ(controller_->GetPendingEntry(), &entry); | 317 CHECK_EQ(controller_->GetPendingEntry(), &entry); |
| 318 | 318 |
| 319 // For security, we should never send non-Web-UI URLs to a Web UI renderer. | 319 // For security, we should never send non-Web-UI URLs to a Web UI renderer. |
| 320 // Double check that here. | 320 // Double check that here. |
| 321 CheckWebUIRendererDoesNotDisplayNormalURL(dest_render_frame_host, dest_url); | 321 CheckWebUIRendererDoesNotDisplayNormalURL(dest_render_frame_host, dest_url); |
| 322 | 322 |
| 323 // Notify observers that we will navigate in this RenderFrame. | |
| 324 if (delegate_) { | |
| 325 delegate_->AboutToNavigateRenderFrame(frame_tree_node->current_frame_host(), | |
| 326 dest_render_frame_host); | |
| 327 } | |
| 328 | |
| 329 // Navigate in the desired RenderFrameHost. | 323 // Navigate in the desired RenderFrameHost. |
| 330 // We can skip this step in the rare case that this is a transfer navigation | 324 // We can skip this step in the rare case that this is a transfer navigation |
| 331 // which began in the chosen RenderFrameHost, since the request has already | 325 // which began in the chosen RenderFrameHost, since the request has already |
| 332 // been issued. In that case, simply resume the response. | 326 // been issued. In that case, simply resume the response. |
| 333 bool is_transfer_to_same = | 327 bool is_transfer_to_same = |
| 334 entry.transferred_global_request_id().child_id != -1 && | 328 entry.transferred_global_request_id().child_id != -1 && |
| 335 entry.transferred_global_request_id().child_id == | 329 entry.transferred_global_request_id().child_id == |
| 336 dest_render_frame_host->GetProcess()->GetID(); | 330 dest_render_frame_host->GetProcess()->GetID(); |
| 337 if (!is_transfer_to_same) { | 331 if (!is_transfer_to_same) { |
| 338 navigation_data_.reset(new NavigationMetricsData(navigation_start, dest_url, | 332 navigation_data_.reset(new NavigationMetricsData(navigation_start, dest_url, |
| (...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 952 entry->set_should_replace_entry(pending_entry->should_replace_entry()); | 946 entry->set_should_replace_entry(pending_entry->should_replace_entry()); |
| 953 entry->SetRedirectChain(pending_entry->GetRedirectChain()); | 947 entry->SetRedirectChain(pending_entry->GetRedirectChain()); |
| 954 } | 948 } |
| 955 controller_->SetPendingEntry(entry.Pass()); | 949 controller_->SetPendingEntry(entry.Pass()); |
| 956 if (delegate_) | 950 if (delegate_) |
| 957 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); | 951 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); |
| 958 } | 952 } |
| 959 } | 953 } |
| 960 | 954 |
| 961 } // namespace content | 955 } // namespace content |
| OLD | NEW |