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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
147 // DidStartProvisionalLoadForFrame. | 147 // DidStartProvisionalLoadForFrame. |
148 // In general, we allow the view to clear the pending entry and typed URL if | 148 // In general, we allow the view to clear the pending entry and typed URL if |
149 // the user requests (e.g., hitting Escape with focus in the address bar). | 149 // the user requests (e.g., hitting Escape with focus in the address bar). |
150 // Note: don't touch the transient entry, since an interstitial may exist. | 150 // Note: don't touch the transient entry, since an interstitial may exist. |
151 if (controller_->GetPendingEntry() != controller_->GetVisibleEntry()) | 151 if (controller_->GetPendingEntry() != controller_->GetVisibleEntry()) |
152 controller_->DiscardPendingEntry(); | 152 controller_->DiscardPendingEntry(); |
153 | 153 |
154 delegate_->DidFailProvisionalLoadWithError(render_frame_host, params); | 154 delegate_->DidFailProvisionalLoadWithError(render_frame_host, params); |
155 } | 155 } |
156 | 156 |
157 void NavigatorImpl::DidRedirectProvisionalLoad( | |
158 RenderFrameHostImpl* render_frame_host, | |
159 int32 page_id, | |
160 const GURL& source_url, | |
161 const GURL& target_url) { | |
162 // TODO(creis): Remove this method and have the pre-rendering code listen to | |
163 // WebContentsObserver::DidGetRedirectForResourceRequest instead. | |
164 // See http://crbug.com/78512. | |
165 GURL validated_source_url(source_url); | |
166 GURL validated_target_url(target_url); | |
167 RenderProcessHost* render_process_host = render_frame_host->GetProcess(); | |
168 render_process_host->FilterURL(false, &validated_source_url); | |
169 render_process_host->FilterURL(false, &validated_target_url); | |
170 NavigationEntry* entry; | |
171 if (page_id == -1) { | |
172 entry = controller_->GetPendingEntry(); | |
173 } else { | |
174 entry = controller_->GetEntryWithPageID(render_frame_host->GetSiteInstance() , | |
jam
2014/01/10 16:19:31
nit: 80 chars
nasko
2014/01/10 19:54:39
Done.
| |
175 page_id); | |
176 } | |
177 if (!entry || entry->GetURL() != validated_source_url) | |
178 return; | |
179 | |
180 delegate_->DidRedirectProvisionalLoad( | |
181 render_frame_host, validated_target_url); | |
182 } | |
183 | |
157 } // namespace content | 184 } // namespace content |
OLD | NEW |