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

Unified Diff: android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc

Issue 1155713005: Use a resource throttle to implement shouldOverrideUrlLoading. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and fix qinmin nit Created 5 years, 5 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: android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc
diff --git a/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc b/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc
index 02160ce9f13534c9343f7e79c147ebea1f3a7f43..da8a60455d103711968efbb0f22ad91c9bd3e2bc 100644
--- a/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc
+++ b/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc
@@ -226,15 +226,16 @@ void AwResourceDispatcherHostDelegate::RequestBeginning(
throttles->push_back(new IoThreadClientThrottle(
request_info->GetChildID(), request_info->GetRenderFrameID(), request));
- // We allow intercepting only navigations within main frames. This
- // is used to post onPageStarted. We handle shouldOverrideUrlLoading
- // via a sync IPC.
- if (resource_type == content::RESOURCE_TYPE_MAIN_FRAME) {
+ if (resource_type == content::RESOURCE_TYPE_MAIN_FRAME ||
+ (resource_type == content::RESOURCE_TYPE_SUB_FRAME &&
+ !request->url().SchemeIs(url::kHttpScheme) &&
+ !request->url().SchemeIs(url::kHttpsScheme) &&
+ !request->url().SchemeIs(url::kAboutScheme))) {
throttles->push_back(InterceptNavigationDelegate::CreateThrottleFor(
request));
- } else {
- InterceptNavigationDelegate::UpdateUserGestureCarryoverInfo(request);
}
+ if (resource_type != content::RESOURCE_TYPE_MAIN_FRAME)
+ InterceptNavigationDelegate::UpdateUserGestureCarryoverInfo(request);
}
void AwResourceDispatcherHostDelegate::OnRequestRedirected(
« no previous file with comments | « android_webview/browser/aw_contents_client_bridge_base.h ('k') | android_webview/common/render_view_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698