Index: content/renderer/render_view_impl.cc |
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc |
index b78531b24dcc3d46317e6e1fb898677aa5908944..8533c1bc460c422e395b0401ea78010c54b472f8 100644 |
--- a/content/renderer/render_view_impl.cc |
+++ b/content/renderer/render_view_impl.cc |
@@ -2864,7 +2864,14 @@ void RenderViewImpl::loadURLExternally( |
WebNavigationPolicy RenderViewImpl::decidePolicyForNavigation( |
WebFrame* frame, const WebURLRequest& request, WebNavigationType type, |
WebNavigationPolicy default_policy, bool is_redirect) { |
- if (request.url() != GURL(kSwappedOutURL) && |
+ // Webkit is asking whether to navigate to a new URL. |
Charlie Reis
2013/08/26 22:17:52
Is there a functional change here, or is this main
sergeygs
2013/08/29 08:24:42
Correct, this is mainly reformatting. I'll revert
|
+ // This is fine normally, except if we're showing UI from one security |
+ // context and they're trying to navigate to a different context. |
+ |
+ const GURL& url = request.url(); |
+ |
+ // Give registered ContentClient a chance to intercept the URL. |
+ if (url != GURL(kSwappedOutURL) && |
GetContentClient()->renderer()->HandleNavigation(frame, request, type, |
default_policy, |
is_redirect)) { |
@@ -2876,7 +2883,7 @@ WebNavigationPolicy RenderViewImpl::decidePolicyForNavigation( |
GetReferrerPolicyFromRequest(frame, request)); |
if (is_swapped_out_) { |
- if (request.url() != GURL(kSwappedOutURL)) { |
+ if (url != GURL(kSwappedOutURL)) { |
// Targeted links may try to navigate a swapped out frame. Allow the |
// browser process to navigate the tab instead. Note that it is also |
// possible for non-targeted navigations (from this view) to arrive |
@@ -2885,7 +2892,7 @@ WebNavigationPolicy RenderViewImpl::decidePolicyForNavigation( |
// TODO(creis): Ensure this supports targeted form submissions when |
// fixing http://crbug.com/101395. |
if (frame->parent() == NULL) { |
- OpenURL(frame, request.url(), referrer, default_policy); |
+ OpenURL(frame, url, referrer, default_policy); |
return WebKit::WebNavigationPolicyIgnore; // Suppress the load here. |
} |
@@ -2898,11 +2905,6 @@ WebNavigationPolicy RenderViewImpl::decidePolicyForNavigation( |
return default_policy; |
} |
- // Webkit is asking whether to navigate to a new URL. |
- // This is fine normally, except if we're showing UI from one security |
- // context and they're trying to navigate to a different context. |
- const GURL& url = request.url(); |
- |
// A content initiated navigation may have originated from a link-click, |
// script, drag-n-drop operation, etc. |
bool is_content_initiated = |