| 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 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 is_transfer && | 368 is_transfer && |
| 369 entry.transferred_global_request_id().child_id == | 369 entry.transferred_global_request_id().child_id == |
| 370 dest_render_frame_host->GetProcess()->GetID(); | 370 dest_render_frame_host->GetProcess()->GetID(); |
| 371 if (!is_transfer_to_same) { | 371 if (!is_transfer_to_same) { |
| 372 navigation_data_.reset(new NavigationMetricsData( | 372 navigation_data_.reset(new NavigationMetricsData( |
| 373 navigation_start, dest_url, entry.restore_type())); | 373 navigation_start, dest_url, entry.restore_type())); |
| 374 // Create the navigation parameters. | 374 // Create the navigation parameters. |
| 375 FrameMsg_Navigate_Type::Value navigation_type = GetNavigationType( | 375 FrameMsg_Navigate_Type::Value navigation_type = GetNavigationType( |
| 376 controller_->GetBrowserContext(), entry, reload_type); | 376 controller_->GetBrowserContext(), entry, reload_type); |
| 377 dest_render_frame_host->Navigate( | 377 dest_render_frame_host->Navigate( |
| 378 entry.ConstructCommonNavigationParams(dest_url, dest_referrer, | 378 entry.ConstructCommonNavigationParams(frame_entry, dest_url, |
| 379 navigation_type, lofi_state, | 379 dest_referrer, navigation_type, |
| 380 navigation_start), | 380 lofi_state, navigation_start), |
| 381 entry.ConstructStartNavigationParams(), | 381 entry.ConstructStartNavigationParams(), |
| 382 entry.ConstructRequestNavigationParams( | 382 entry.ConstructRequestNavigationParams( |
| 383 frame_entry, is_same_document_history_load, | 383 frame_entry, is_same_document_history_load, |
| 384 frame_tree_node->has_committed_real_load(), | 384 frame_tree_node->has_committed_real_load(), |
| 385 controller_->GetPendingEntryIndex() == -1, | 385 controller_->GetPendingEntryIndex() == -1, |
| 386 controller_->GetIndexOfEntry(&entry), | 386 controller_->GetIndexOfEntry(&entry), |
| 387 controller_->GetLastCommittedEntryIndex(), | 387 controller_->GetLastCommittedEntryIndex(), |
| 388 controller_->GetEntryCount())); | 388 controller_->GetEntryCount())); |
| 389 } else { | 389 } else { |
| 390 // No need to navigate again. Just resume the deferred request. | 390 // No need to navigate again. Just resume the deferred request. |
| (...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 856 | 856 |
| 857 // If the request was canceled by the user do not show an error page. | 857 // If the request was canceled by the user do not show an error page. |
| 858 if (error_code == net::ERR_ABORTED) { | 858 if (error_code == net::ERR_ABORTED) { |
| 859 frame_tree_node->ResetNavigationRequest(false); | 859 frame_tree_node->ResetNavigationRequest(false); |
| 860 return; | 860 return; |
| 861 } | 861 } |
| 862 | 862 |
| 863 // Select an appropriate renderer to show the error page. | 863 // Select an appropriate renderer to show the error page. |
| 864 RenderFrameHostImpl* render_frame_host = | 864 RenderFrameHostImpl* render_frame_host = |
| 865 frame_tree_node->render_manager()->GetFrameHostForNavigation( | 865 frame_tree_node->render_manager()->GetFrameHostForNavigation( |
| 866 *navigation_request); | 866 navigation_request, true); |
| 867 CheckWebUIRendererDoesNotDisplayNormalURL( | 867 CheckWebUIRendererDoesNotDisplayNormalURL( |
| 868 render_frame_host, navigation_request->common_params().url); | 868 render_frame_host, navigation_request->common_params().url); |
| 869 | 869 |
| 870 navigation_request->TransferNavigationHandleOwnership(render_frame_host); | 870 navigation_request->TransferNavigationHandleOwnership(render_frame_host); |
| 871 render_frame_host->navigation_handle()->ReadyToCommitNavigation( | 871 render_frame_host->navigation_handle()->ReadyToCommitNavigation( |
| 872 render_frame_host); | 872 render_frame_host); |
| 873 render_frame_host->FailedNavigation(navigation_request->common_params(), | 873 render_frame_host->FailedNavigation(navigation_request->common_params(), |
| 874 navigation_request->request_params(), | 874 navigation_request->request_params(), |
| 875 has_stale_copy_in_cache, error_code); | 875 has_stale_copy_in_cache, error_code); |
| 876 } | 876 } |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1091 if (pending_entry != controller_->GetVisibleEntry() || | 1091 if (pending_entry != controller_->GetVisibleEntry() || |
| 1092 !should_preserve_entry) { | 1092 !should_preserve_entry) { |
| 1093 controller_->DiscardPendingEntry(true); | 1093 controller_->DiscardPendingEntry(true); |
| 1094 | 1094 |
| 1095 // Also force the UI to refresh. | 1095 // Also force the UI to refresh. |
| 1096 controller_->delegate()->NotifyNavigationStateChanged(INVALIDATE_TYPE_URL); | 1096 controller_->delegate()->NotifyNavigationStateChanged(INVALIDATE_TYPE_URL); |
| 1097 } | 1097 } |
| 1098 } | 1098 } |
| 1099 | 1099 |
| 1100 } // namespace content | 1100 } // namespace content |
| OLD | NEW |