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 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 is_transfer && | 373 is_transfer && |
374 entry.transferred_global_request_id().child_id == | 374 entry.transferred_global_request_id().child_id == |
375 dest_render_frame_host->GetProcess()->GetID(); | 375 dest_render_frame_host->GetProcess()->GetID(); |
376 if (!is_transfer_to_same) { | 376 if (!is_transfer_to_same) { |
377 navigation_data_.reset(new NavigationMetricsData( | 377 navigation_data_.reset(new NavigationMetricsData( |
378 navigation_start, dest_url, entry.restore_type())); | 378 navigation_start, dest_url, entry.restore_type())); |
379 // Create the navigation parameters. | 379 // Create the navigation parameters. |
380 FrameMsg_Navigate_Type::Value navigation_type = GetNavigationType( | 380 FrameMsg_Navigate_Type::Value navigation_type = GetNavigationType( |
381 controller_->GetBrowserContext(), entry, reload_type); | 381 controller_->GetBrowserContext(), entry, reload_type); |
382 dest_render_frame_host->Navigate( | 382 dest_render_frame_host->Navigate( |
383 entry.ConstructCommonNavigationParams(dest_url, dest_referrer, | 383 entry.ConstructCommonNavigationParams(frame_entry, dest_url, |
384 navigation_type, lofi_state, | 384 dest_referrer, navigation_type, |
385 navigation_start), | 385 lofi_state, navigation_start), |
386 entry.ConstructStartNavigationParams(), | 386 entry.ConstructStartNavigationParams(), |
387 entry.ConstructRequestNavigationParams( | 387 entry.ConstructRequestNavigationParams( |
388 frame_entry, is_same_document_history_load, | 388 frame_entry, is_same_document_history_load, |
389 frame_tree_node->has_committed_real_load(), | 389 frame_tree_node->has_committed_real_load(), |
390 controller_->GetPendingEntryIndex() == -1, | 390 controller_->GetPendingEntryIndex() == -1, |
391 controller_->GetIndexOfEntry(&entry), | 391 controller_->GetIndexOfEntry(&entry), |
392 controller_->GetLastCommittedEntryIndex(), | 392 controller_->GetLastCommittedEntryIndex(), |
393 controller_->GetEntryCount())); | 393 controller_->GetEntryCount())); |
394 } else { | 394 } else { |
395 // No need to navigate again. Just resume the deferred request. | 395 // No need to navigate again. Just resume the deferred request. |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 frame_entry->set_frame_tree_node_id( | 451 frame_entry->set_frame_tree_node_id( |
452 render_frame_host->frame_tree_node()->frame_tree_node_id()); | 452 render_frame_host->frame_tree_node()->frame_tree_node_id()); |
453 | 453 |
454 return NavigateToEntry(render_frame_host->frame_tree_node(), *frame_entry, | 454 return NavigateToEntry(render_frame_host->frame_tree_node(), *frame_entry, |
455 *entry, NavigationControllerImpl::NO_RELOAD, false, | 455 *entry, NavigationControllerImpl::NO_RELOAD, false, |
456 false); | 456 false); |
457 } | 457 } |
458 | 458 |
459 void NavigatorImpl::DidNavigate( | 459 void NavigatorImpl::DidNavigate( |
460 RenderFrameHostImpl* render_frame_host, | 460 RenderFrameHostImpl* render_frame_host, |
461 const FrameHostMsg_DidCommitProvisionalLoad_Params& params) { | 461 const FrameHostMsg_DidCommitProvisionalLoad_Params& params, |
| 462 scoped_refptr<ResourceRequestBody> post_data) { |
462 FrameTree* frame_tree = render_frame_host->frame_tree_node()->frame_tree(); | 463 FrameTree* frame_tree = render_frame_host->frame_tree_node()->frame_tree(); |
463 bool oopifs_possible = SiteIsolationPolicy::AreCrossProcessFramesPossible(); | 464 bool oopifs_possible = SiteIsolationPolicy::AreCrossProcessFramesPossible(); |
464 | 465 |
465 bool has_embedded_credentials = | 466 bool has_embedded_credentials = |
466 params.url.has_username() || params.url.has_password(); | 467 params.url.has_username() || params.url.has_password(); |
467 UMA_HISTOGRAM_BOOLEAN("Navigation.FrameHasEmbeddedCredentials", | 468 UMA_HISTOGRAM_BOOLEAN("Navigation.FrameHasEmbeddedCredentials", |
468 has_embedded_credentials); | 469 has_embedded_credentials); |
469 | 470 |
470 bool is_navigation_within_page = controller_->IsURLInPageNavigation( | 471 bool is_navigation_within_page = controller_->IsURLInPageNavigation( |
471 params.url, params.was_within_same_page, render_frame_host); | 472 params.url, params.was_within_same_page, render_frame_host); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
549 // (see http://code.google.com/p/chromium/issues/detail?id=2929 ) | 550 // (see http://code.google.com/p/chromium/issues/detail?id=2929 ) |
550 // TODO(jungshik): Add a test for the encoding menu to avoid | 551 // TODO(jungshik): Add a test for the encoding menu to avoid |
551 // regressing it again. | 552 // regressing it again. |
552 // TODO(nasko): Verify the correctness of the above comment, since some of the | 553 // TODO(nasko): Verify the correctness of the above comment, since some of the |
553 // code doesn't exist anymore. Also, move this code in the | 554 // code doesn't exist anymore. Also, move this code in the |
554 // PageTransitionIsMainFrame code block above. | 555 // PageTransitionIsMainFrame code block above. |
555 if (ui::PageTransitionIsMainFrame(params.transition) && delegate_) | 556 if (ui::PageTransitionIsMainFrame(params.transition) && delegate_) |
556 delegate_->SetMainFrameMimeType(params.contents_mime_type); | 557 delegate_->SetMainFrameMimeType(params.contents_mime_type); |
557 | 558 |
558 LoadCommittedDetails details; | 559 LoadCommittedDetails details; |
559 bool did_navigate = controller_->RendererDidNavigate(render_frame_host, | 560 bool did_navigate = controller_->RendererDidNavigate( |
560 params, &details); | 561 render_frame_host, params, &details, post_data); |
561 | 562 |
562 // Keep track of each frame's URL in its FrameTreeNode, whether it's for a net | 563 // Keep track of each frame's URL in its FrameTreeNode, whether it's for a net |
563 // error or not. | 564 // error or not. |
564 // TODO(creis): Move the last committed URL to RenderFrameHostImpl. | 565 // TODO(creis): Move the last committed URL to RenderFrameHostImpl. |
565 render_frame_host->frame_tree_node()->SetCurrentURL(params.url); | 566 render_frame_host->frame_tree_node()->SetCurrentURL(params.url); |
566 | 567 |
567 // Separately, update the frame's last successful URL except for net error | 568 // Separately, update the frame's last successful URL except for net error |
568 // pages, since those do not end up in the correct process after transfers | 569 // pages, since those do not end up in the correct process after transfers |
569 // (see https://crbug.com/560511). Instead, the next cross-process navigation | 570 // (see https://crbug.com/560511). Instead, the next cross-process navigation |
570 // or transfer should decide whether to swap as if the net error had not | 571 // or transfer should decide whether to swap as if the net error had not |
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1105 if (pending_entry != controller_->GetVisibleEntry() || | 1106 if (pending_entry != controller_->GetVisibleEntry() || |
1106 !should_preserve_entry) { | 1107 !should_preserve_entry) { |
1107 controller_->DiscardPendingEntry(true); | 1108 controller_->DiscardPendingEntry(true); |
1108 | 1109 |
1109 // Also force the UI to refresh. | 1110 // Also force the UI to refresh. |
1110 controller_->delegate()->NotifyNavigationStateChanged(INVALIDATE_TYPE_URL); | 1111 controller_->delegate()->NotifyNavigationStateChanged(INVALIDATE_TYPE_URL); |
1111 } | 1112 } |
1112 } | 1113 } |
1113 | 1114 |
1114 } // namespace content | 1115 } // namespace content |
OLD | NEW |