Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2449)

Unified Diff: content/renderer/render_view_impl.cc

Issue 22944002: Implementation of the "Redirect URLs to Packaged Apps" feature. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 1) Fixed broken redirection for in-page WebKit-initiated navigations. All redirections work now. 2)… Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 =

Powered by Google App Engine
This is Rietveld 408576698