Chromium Code Reviews| Index: content/renderer/render_view_impl.cc |
| diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc |
| index 664eb5936238e63e2006191bead37ff7dd2bc704..676a5479cd798e1173f164cefacdd9c801879c58 100644 |
| --- a/content/renderer/render_view_impl.cc |
| +++ b/content/renderer/render_view_impl.cc |
| @@ -2325,18 +2325,24 @@ WebNavigationPolicy RenderViewImpl::decidePolicyForNavigation( |
| // If the browser is interested, then give it a chance to look at top level |
| // navigations. |
| - if (is_content_initiated) { |
| - bool browser_handles_top_level_requests = |
| - renderer_preferences_.browser_handles_top_level_requests && |
| - IsNonLocalTopLevelNavigation(url, frame, type); |
| - if (browser_handles_top_level_requests || |
| + if (renderer_preferences_.browser_handles_top_level_requests) { |
| + if (IsNonLocalTopLevelNavigation(url, frame, type) || |
| renderer_preferences_.browser_handles_all_requests) { |
| // Reset these counters as the RenderView could be reused for the next |
| // navigation. |
| page_id_ = -1; |
| last_page_id_sent_to_browser_ = -1; |
| - OpenURL(frame, url, referrer, default_policy); |
| - return WebKit::WebNavigationPolicyIgnore; // Suppress the load here. |
| + bool ignore_navigation = false; |
| + Send(new ViewHostMsg_ShouldIgnoreNavigation( |
| + routing_id_, |
| + url, |
| + referrer, |
| + NavigationPolicyToDisposition(default_policy), |
| + frame->identifier(), |
| + is_content_initiated, |
| + &ignore_navigation)); |
| + if (ignore_navigation) |
| + return WebKit::WebNavigationPolicyIgnore; |
|
Charlie Reis
2012/04/04 20:23:22
Darin, can you take a look at this? Adding synchr
mkosiba (inactive)
2012/04/04 20:40:45
The alternative is to change FrameLoaderClientImpl
|
| } |
| } |
| @@ -5156,8 +5162,14 @@ bool RenderViewImpl::IsNonLocalTopLevelNavigation( |
| // 2. The origin of the url and the opener is the same in which case the |
| // opener relationship is maintained. |
| // 3. Reloads/form submits/back forward navigations |
| +#if defined(OS_ANDROID) |
| + // It is possible for applications to register handlers for URLs (like |
| + // http://maps.google.com/), so we do need to consider http:// and https:// |
| + // URLs as well as anything else. |
| +#else |
| if (!url.SchemeIs(chrome::kHttpScheme) && !url.SchemeIs(chrome::kHttpsScheme)) |
| return false; |
| +#endif |
| // Not interested in reloads/form submits/resubmits/back forward navigations. |
| if (type != WebKit::WebNavigationTypeReload && |