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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 // Avoid downloading when in view-source mode. | 101 // Avoid downloading when in view-source mode. |
102 params->allow_download = !entry.IsViewSourceMode(); | 102 params->allow_download = !entry.IsViewSourceMode(); |
103 params->is_post = entry.GetHasPostData(); | 103 params->is_post = entry.GetHasPostData(); |
104 if (entry.GetBrowserInitiatedPostData()) { | 104 if (entry.GetBrowserInitiatedPostData()) { |
105 params->browser_initiated_post_data.assign( | 105 params->browser_initiated_post_data.assign( |
106 entry.GetBrowserInitiatedPostData()->front(), | 106 entry.GetBrowserInitiatedPostData()->front(), |
107 entry.GetBrowserInitiatedPostData()->front() + | 107 entry.GetBrowserInitiatedPostData()->front() + |
108 entry.GetBrowserInitiatedPostData()->size()); | 108 entry.GetBrowserInitiatedPostData()->size()); |
109 } | 109 } |
110 | 110 |
111 params->redirects = entry.redirect_chain(); | 111 // Set the redirect chain to the navigation's redirects, unless we are |
| 112 // returning to a completed navigation (whose previous redirects don't apply). |
| 113 if (PageTransitionIsNewNavigation(params->transition)) { |
| 114 params->redirects = entry.GetRedirectChain(); |
| 115 } else { |
| 116 params->redirects.clear(); |
| 117 } |
112 | 118 |
113 params->can_load_local_resources = entry.GetCanLoadLocalResources(); | 119 params->can_load_local_resources = entry.GetCanLoadLocalResources(); |
114 params->frame_to_navigate = entry.GetFrameToNavigate(); | 120 params->frame_to_navigate = entry.GetFrameToNavigate(); |
115 } | 121 } |
116 | 122 |
117 RenderFrameHostManager* GetRenderManager(RenderFrameHostImpl* rfh) { | 123 RenderFrameHostManager* GetRenderManager(RenderFrameHostImpl* rfh) { |
118 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSitePerProcess)) | 124 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSitePerProcess)) |
119 return rfh->frame_tree_node()->render_manager(); | 125 return rfh->frame_tree_node()->render_manager(); |
120 | 126 |
121 return rfh->frame_tree_node()->frame_tree()->root()->render_manager(); | 127 return rfh->frame_tree_node()->frame_tree()->root()->render_manager(); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 controller_->GetBrowserContext())); | 168 controller_->GetBrowserContext())); |
163 entry->set_site_instance( | 169 entry->set_site_instance( |
164 static_cast<SiteInstanceImpl*>( | 170 static_cast<SiteInstanceImpl*>( |
165 render_frame_host->render_view_host()->GetSiteInstance())); | 171 render_frame_host->render_view_host()->GetSiteInstance())); |
166 // TODO(creis): If there's a pending entry already, find a safe way to | 172 // TODO(creis): If there's a pending entry already, find a safe way to |
167 // update it instead of replacing it and copying over things like this. | 173 // update it instead of replacing it and copying over things like this. |
168 if (pending_entry) { | 174 if (pending_entry) { |
169 entry->set_transferred_global_request_id( | 175 entry->set_transferred_global_request_id( |
170 pending_entry->transferred_global_request_id()); | 176 pending_entry->transferred_global_request_id()); |
171 entry->set_should_replace_entry(pending_entry->should_replace_entry()); | 177 entry->set_should_replace_entry(pending_entry->should_replace_entry()); |
172 entry->set_redirect_chain(pending_entry->redirect_chain()); | 178 entry->SetRedirectChain(pending_entry->GetRedirectChain()); |
173 } | 179 } |
174 controller_->SetPendingEntry(entry); | 180 controller_->SetPendingEntry(entry); |
175 if (delegate_) | 181 if (delegate_) |
176 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); | 182 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); |
177 } | 183 } |
178 } | 184 } |
179 | 185 |
180 if (delegate_) { | 186 if (delegate_) { |
181 // Notify the observer about the start of the provisional load. | 187 // Notify the observer about the start of the provisional load. |
182 delegate_->DidStartProvisionalLoad( | 188 delegate_->DidStartProvisionalLoad( |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
591 | 597 |
592 // Navigations in Web UI pages count as browser-initiated navigations. | 598 // Navigations in Web UI pages count as browser-initiated navigations. |
593 params.is_renderer_initiated = false; | 599 params.is_renderer_initiated = false; |
594 } | 600 } |
595 | 601 |
596 if (delegate_) | 602 if (delegate_) |
597 delegate_->RequestOpenURL(render_frame_host, params); | 603 delegate_->RequestOpenURL(render_frame_host, params); |
598 } | 604 } |
599 | 605 |
600 } // namespace content | 606 } // namespace content |
OLD | NEW |