Index: content/renderer/render_view_impl.cc |
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc |
index 8103dc5789f5a0a289609077a5e79c0c31aa752c..0fa2f1e27d2c68dc419a652b6d67e0edb327e9a2 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) { |
Charlie Reis
2012/04/05 17:06:53
I thought this was here so it didn't send browser-
mkosiba (inactive)
2012/04/10 17:58:37
The change is here so that Chrome on *Android* doe
|
- 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; |
} |
} |
@@ -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 |
Charlie Reis
2012/04/05 17:06:53
This also makes me nervous. I'd rather have a wel
groby-ooo-7-16
2012/04/05 22:51:19
Specifically, unless I misread the intent - this d
mkosiba (inactive)
2012/04/10 17:58:37
Agreed. My bad for sticking this in to the CL - th
|
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 && |