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/time/time.h" | 8 #include "base/time/time.h" |
9 #include "content/browser/frame_host/frame_tree.h" | 9 #include "content/browser/frame_host/frame_tree.h" |
10 #include "content/browser/frame_host/frame_tree_node.h" | 10 #include "content/browser/frame_host/frame_tree_node.h" |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
157 bool is_transition_navigation) { | 157 bool is_transition_navigation) { |
158 bool is_error_page = (url.spec() == kUnreachableWebDataURL); | 158 bool is_error_page = (url.spec() == kUnreachableWebDataURL); |
159 bool is_iframe_srcdoc = (url.spec() == kAboutSrcDocURL); | 159 bool is_iframe_srcdoc = (url.spec() == kAboutSrcDocURL); |
160 GURL validated_url(url); | 160 GURL validated_url(url); |
161 RenderProcessHost* render_process_host = render_frame_host->GetProcess(); | 161 RenderProcessHost* render_process_host = render_frame_host->GetProcess(); |
162 render_process_host->FilterURL(false, &validated_url); | 162 render_process_host->FilterURL(false, &validated_url); |
163 | 163 |
164 bool is_main_frame = render_frame_host->frame_tree_node()->IsMainFrame(); | 164 bool is_main_frame = render_frame_host->frame_tree_node()->IsMainFrame(); |
165 NavigationEntryImpl* pending_entry = | 165 NavigationEntryImpl* pending_entry = |
166 NavigationEntryImpl::FromNavigationEntry(controller_->GetPendingEntry()); | 166 NavigationEntryImpl::FromNavigationEntry(controller_->GetPendingEntry()); |
167 if (pending_entry && is_error_page) | |
168 pending_entry->set_page_type(PAGE_TYPE_ERROR); | |
Charlie Reis
2014/09/22 21:43:53
I question whether we should do this on the pendin
wjmaclean
2014/09/23 18:42:38
Ooops, this was meant to be deleted.
| |
167 if (is_main_frame) { | 169 if (is_main_frame) { |
168 // If there is no browser-initiated pending entry for this navigation and it | 170 // If there is no browser-initiated pending entry for this navigation and it |
169 // is not for the error URL, create a pending entry using the current | 171 // is not for the error URL, create a pending entry using the current |
170 // SiteInstance, and ensure the address bar updates accordingly. We don't | 172 // SiteInstance, and ensure the address bar updates accordingly. We don't |
171 // know the referrer or extra headers at this point, but the referrer will | 173 // know the referrer or extra headers at this point, but the referrer will |
172 // be set properly upon commit. | 174 // be set properly upon commit. |
173 bool has_browser_initiated_pending_entry = pending_entry && | 175 bool has_browser_initiated_pending_entry = pending_entry && |
174 !pending_entry->is_renderer_initiated(); | 176 !pending_entry->is_renderer_initiated(); |
175 if (!has_browser_initiated_pending_entry && !is_error_page) { | 177 if (!has_browser_initiated_pending_entry && !is_error_page) { |
176 NavigationEntryImpl* entry = NavigationEntryImpl::FromNavigationEntry( | 178 NavigationEntryImpl* entry = NavigationEntryImpl::FromNavigationEntry( |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
531 // entry list. | 533 // entry list. |
532 if (did_navigate && | 534 if (did_navigate && |
533 (controller_->GetLastCommittedEntry()->GetTransitionType() & | 535 (controller_->GetLastCommittedEntry()->GetTransitionType() & |
534 ui::PAGE_TRANSITION_FORWARD_BACK)) { | 536 ui::PAGE_TRANSITION_FORWARD_BACK)) { |
535 transition_type = ui::PageTransitionFromInt( | 537 transition_type = ui::PageTransitionFromInt( |
536 params.transition | ui::PAGE_TRANSITION_FORWARD_BACK); | 538 params.transition | ui::PAGE_TRANSITION_FORWARD_BACK); |
537 } | 539 } |
538 | 540 |
539 delegate_->DidCommitProvisionalLoad(render_frame_host, | 541 delegate_->DidCommitProvisionalLoad(render_frame_host, |
540 params.url, | 542 params.url, |
543 params.url_is_unreachable, | |
Charlie Reis
2014/09/22 21:43:53
Why is this needed here? I thought we only needed
wjmaclean
2014/09/23 18:42:38
I was concerned about the page-type getting reset
| |
541 transition_type); | 544 transition_type); |
542 } | 545 } |
543 | 546 |
544 if (!did_navigate) | 547 if (!did_navigate) |
545 return; // No navigation happened. | 548 return; // No navigation happened. |
546 | 549 |
547 // DO NOT ADD MORE STUFF TO THIS FUNCTION! Your component should either listen | 550 // DO NOT ADD MORE STUFF TO THIS FUNCTION! Your component should either listen |
548 // for the appropriate notification (best) or you can add it to | 551 // for the appropriate notification (best) or you can add it to |
549 // DidNavigateMainFramePostCommit / DidNavigateAnyFramePostCommit (only if | 552 // DidNavigateMainFramePostCommit / DidNavigateAnyFramePostCommit (only if |
550 // necessary, please). | 553 // necessary, please). |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
682 controller_->GetBrowserContext(), url); | 685 controller_->GetBrowserContext(), url); |
683 if ((enabled_bindings & BINDINGS_POLICY_WEB_UI) && | 686 if ((enabled_bindings & BINDINGS_POLICY_WEB_UI) && |
684 !is_allowed_in_web_ui_renderer) { | 687 !is_allowed_in_web_ui_renderer) { |
685 // Log the URL to help us diagnose any future failures of this CHECK. | 688 // Log the URL to help us diagnose any future failures of this CHECK. |
686 GetContentClient()->SetActiveURL(url); | 689 GetContentClient()->SetActiveURL(url); |
687 CHECK(0); | 690 CHECK(0); |
688 } | 691 } |
689 } | 692 } |
690 | 693 |
691 } // namespace content | 694 } // namespace content |
OLD | NEW |