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 "content/browser/frame_host/frame_tree.h" | 8 #include "content/browser/frame_host/frame_tree.h" |
9 #include "content/browser/frame_host/frame_tree_node.h" | 9 #include "content/browser/frame_host/frame_tree_node.h" |
10 #include "content/browser/frame_host/navigation_controller_impl.h" | 10 #include "content/browser/frame_host/navigation_controller_impl.h" |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
98 // Avoid downloading when in view-source mode. | 98 // Avoid downloading when in view-source mode. |
99 params->allow_download = !entry.IsViewSourceMode(); | 99 params->allow_download = !entry.IsViewSourceMode(); |
100 params->is_post = entry.GetHasPostData(); | 100 params->is_post = entry.GetHasPostData(); |
101 if (entry.GetBrowserInitiatedPostData()) { | 101 if (entry.GetBrowserInitiatedPostData()) { |
102 params->browser_initiated_post_data.assign( | 102 params->browser_initiated_post_data.assign( |
103 entry.GetBrowserInitiatedPostData()->front(), | 103 entry.GetBrowserInitiatedPostData()->front(), |
104 entry.GetBrowserInitiatedPostData()->front() + | 104 entry.GetBrowserInitiatedPostData()->front() + |
105 entry.GetBrowserInitiatedPostData()->size()); | 105 entry.GetBrowserInitiatedPostData()->size()); |
106 } | 106 } |
107 | 107 |
108 params->redirects = entry.redirect_chain(); | 108 // Set the redirect chain to the navigation's redirects, unless we are |
109 // returning to a completed navigation (whose previous redirects don't apply). | |
110 bool is_transition_reload = PageTransitionCoreTypeIs( | |
111 params->transition, content::PAGE_TRANSITION_RELOAD); | |
112 bool is_transition_forward_back = PageTransitionIsForwardBack( | |
Charlie Reis
2014/03/31 22:06:08
Does PageTransitionIsRedirect not suffice here?
donnd
2014/04/01 04:36:26
No, returning to any previously committed navigati
brettw
2014/04/01 06:28:52
Ah, so this answer seems to be different than we w
donnd
2014/04/01 18:31:09
No, they need to be preserved in the original navi
| |
113 params->transition); | |
114 if (is_transition_forward_back || is_transition_reload) { | |
115 params->redirects = std::vector<GURL>(); | |
116 } else { | |
117 params->redirects = entry.GetRedirectChain(); | |
118 } | |
109 | 119 |
110 params->can_load_local_resources = entry.GetCanLoadLocalResources(); | 120 params->can_load_local_resources = entry.GetCanLoadLocalResources(); |
111 params->frame_to_navigate = entry.GetFrameToNavigate(); | 121 params->frame_to_navigate = entry.GetFrameToNavigate(); |
112 } | 122 } |
113 | 123 |
114 } // namespace | 124 } // namespace |
115 | 125 |
116 | 126 |
117 NavigatorImpl::NavigatorImpl( | 127 NavigatorImpl::NavigatorImpl( |
118 NavigationControllerImpl* navigation_controller, | 128 NavigationControllerImpl* navigation_controller, |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
161 controller_->GetBrowserContext())); | 171 controller_->GetBrowserContext())); |
162 entry->set_site_instance( | 172 entry->set_site_instance( |
163 static_cast<SiteInstanceImpl*>( | 173 static_cast<SiteInstanceImpl*>( |
164 render_frame_host->render_view_host()->GetSiteInstance())); | 174 render_frame_host->render_view_host()->GetSiteInstance())); |
165 // TODO(creis): If there's a pending entry already, find a safe way to | 175 // TODO(creis): If there's a pending entry already, find a safe way to |
166 // update it instead of replacing it and copying over things like this. | 176 // update it instead of replacing it and copying over things like this. |
167 if (pending_entry) { | 177 if (pending_entry) { |
168 entry->set_transferred_global_request_id( | 178 entry->set_transferred_global_request_id( |
169 pending_entry->transferred_global_request_id()); | 179 pending_entry->transferred_global_request_id()); |
170 entry->set_should_replace_entry(pending_entry->should_replace_entry()); | 180 entry->set_should_replace_entry(pending_entry->should_replace_entry()); |
171 entry->set_redirect_chain(pending_entry->redirect_chain()); | 181 entry->SetRedirectChain(pending_entry->GetRedirectChain()); |
172 } | 182 } |
173 controller_->SetPendingEntry(entry); | 183 controller_->SetPendingEntry(entry); |
174 if (delegate_) | 184 if (delegate_) |
175 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); | 185 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); |
176 } | 186 } |
177 } | 187 } |
178 | 188 |
179 if (delegate_) { | 189 if (delegate_) { |
180 // Notify the observer about the start of the provisional load. | 190 // Notify the observer about the start of the provisional load. |
181 delegate_->DidStartProvisionalLoad( | 191 delegate_->DidStartProvisionalLoad( |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
527 // still be used for a normal web site. | 537 // still be used for a normal web site. |
528 if (url == GURL(kAboutBlankURL)) | 538 if (url == GURL(kAboutBlankURL)) |
529 return false; | 539 return false; |
530 | 540 |
531 // The embedder will then have the opportunity to determine if the URL | 541 // The embedder will then have the opportunity to determine if the URL |
532 // should "use up" the SiteInstance. | 542 // should "use up" the SiteInstance. |
533 return GetContentClient()->browser()->ShouldAssignSiteForURL(url); | 543 return GetContentClient()->browser()->ShouldAssignSiteForURL(url); |
534 } | 544 } |
535 | 545 |
536 } // namespace content | 546 } // namespace content |
OLD | NEW |