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

Unified Diff: chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc

Issue 615433002: Add a resource throttle for sub frame unless scheme of uri is acceptable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « chrome/browser/android/url_utilities.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
diff --git a/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc b/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
index 0863976386bf431323f5792f059b139d5fbcec38..a7969e628bb6ebb924a9c6de3ebf4230aa42ffd9 100644
--- a/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
+++ b/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
@@ -85,6 +85,7 @@
#if defined(OS_ANDROID)
#include "chrome/browser/android/intercept_download_resource_throttle.h"
+#include "chrome/browser/android/url_utilities.h"
#include "chrome/browser/ui/android/infobars/auto_login_prompter.h"
#include "components/navigation_interception/intercept_navigation_delegate.h"
#endif
@@ -323,7 +324,15 @@ void ChromeResourceDispatcherHostDelegate::RequestBeginning(
#if defined(OS_ANDROID)
// TODO(davidben): This is insufficient to integrate with prerender properly.
// https://crbug.com/370595
- if (resource_type == content::RESOURCE_TYPE_MAIN_FRAME && !is_prerendering) {
+ //
+ // https://crbug.com/410524: If the requested url can't be handled by chrome
+ // showing a dedicated app or an intent picker even for sub frame is better
+ // than showing an error page. In this case, chrome won't be listed in an
+ // intent picker as an option.
+ if (!is_prerendering && (resource_type == content::RESOURCE_TYPE_MAIN_FRAME ||
+ (resource_type == content::RESOURCE_TYPE_SUB_FRAME &&
+ !IsAcceptedScheme(request->url().spec()) &&
+ !IsDownloadableScheme(request->url().spec())))) {
throttles->push_back(
InterceptNavigationDelegate::CreateThrottleFor(request));
}
« no previous file with comments | « chrome/browser/android/url_utilities.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698