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 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 // Whether or not a page transition was triggered by going backward or | 484 // Whether or not a page transition was triggered by going backward or |
485 // forward in the history is only stored in the navigation controller's | 485 // forward in the history is only stored in the navigation controller's |
486 // entry list. | 486 // entry list. |
487 if (did_navigate && | 487 if (did_navigate && |
488 (controller_->GetLastCommittedEntry()->GetTransitionType() & | 488 (controller_->GetLastCommittedEntry()->GetTransitionType() & |
489 ui::PAGE_TRANSITION_FORWARD_BACK)) { | 489 ui::PAGE_TRANSITION_FORWARD_BACK)) { |
490 transition_type = ui::PageTransitionFromInt( | 490 transition_type = ui::PageTransitionFromInt( |
491 params.transition | ui::PAGE_TRANSITION_FORWARD_BACK); | 491 params.transition | ui::PAGE_TRANSITION_FORWARD_BACK); |
492 } | 492 } |
493 | 493 |
494 delegate_->DidCommitProvisionalLoad(render_frame_host, | 494 NavigationEntryImpl* entry = controller_->GetLastCommittedEntry(); |
495 params.url, | 495 bool use_virtual_url = |
| 496 entry->GetVirtualURL().is_valid() && entry->GetURL().is_valid() && |
| 497 entry->GetDataURLWithBaseURL().SchemeIs(url::kDataScheme); |
| 498 GURL url = use_virtual_url ? entry->GetVirtualURL() : params.url; |
| 499 delegate_->DidCommitProvisionalLoad(render_frame_host, url, |
496 transition_type); | 500 transition_type); |
497 render_frame_host->navigation_handle()->DidCommitNavigation( | 501 render_frame_host->navigation_handle()->DidCommitNavigation( |
498 is_navigation_within_page, render_frame_host); | 502 is_navigation_within_page, render_frame_host); |
499 render_frame_host->SetNavigationHandle(nullptr); | 503 render_frame_host->SetNavigationHandle(nullptr); |
500 } | 504 } |
501 | 505 |
502 if (!did_navigate) | 506 if (!did_navigate) |
503 return; // No navigation happened. | 507 return; // No navigation happened. |
504 | 508 |
505 // DO NOT ADD MORE STUFF TO THIS FUNCTION! Your component should either listen | 509 // DO NOT ADD MORE STUFF TO THIS FUNCTION! Your component should either listen |
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
954 entry->set_should_replace_entry(pending_entry->should_replace_entry()); | 958 entry->set_should_replace_entry(pending_entry->should_replace_entry()); |
955 entry->SetRedirectChain(pending_entry->GetRedirectChain()); | 959 entry->SetRedirectChain(pending_entry->GetRedirectChain()); |
956 } | 960 } |
957 controller_->SetPendingEntry(entry.Pass()); | 961 controller_->SetPendingEntry(entry.Pass()); |
958 if (delegate_) | 962 if (delegate_) |
959 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); | 963 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); |
960 } | 964 } |
961 } | 965 } |
962 | 966 |
963 } // namespace content | 967 } // namespace content |
OLD | NEW |