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

Unified Diff: android_webview/browser/aw_content_browser_client.cc

Issue 1357803004: Reland of Add a NavigationThrottle to the public content/ interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@navigation-api
Patch Set: Created 5 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
Index: android_webview/browser/aw_content_browser_client.cc
diff --git a/android_webview/browser/aw_content_browser_client.cc b/android_webview/browser/aw_content_browser_client.cc
index 759c844b9ba903e6e713e0a2af56b669c2867384..ab14d49bdbb54982b24b77775a5836cb166107bd 100644
--- a/android_webview/browser/aw_content_browser_client.cc
+++ b/android_webview/browser/aw_content_browser_client.cc
@@ -25,10 +25,13 @@
#include "base/command_line.h"
#include "base/path_service.h"
#include "components/cdm/browser/cdm_message_filter_android.h"
+#include "components/navigation_interception/intercept_navigation_delegate.h"
#include "content/public/browser/access_token_store.h"
#include "content/public/browser/browser_message_filter.h"
#include "content/public/browser/child_process_security_policy.h"
#include "content/public/browser/client_certificate_delegate.h"
+#include "content/public/browser/navigation_handle.h"
+#include "content/public/browser/navigation_throttle.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
@@ -487,6 +490,22 @@
content::WebContents::FromRenderViewHost(rvh), web_prefs);
}
+ScopedVector<content::NavigationThrottle>
+AwContentBrowserClient::CreateThrottlesForNavigation(
+ content::NavigationHandle* navigation_handle) {
+ ScopedVector<content::NavigationThrottle> throttles;
+ if (navigation_handle->IsInMainFrame() ||
+ (!navigation_handle->GetURL().SchemeIs(url::kHttpScheme) &&
+ !navigation_handle->GetURL().SchemeIs(url::kHttpsScheme) &&
+ !navigation_handle->GetURL().SchemeIs(url::kAboutScheme))) {
+ throttles.push_back(
+ navigation_interception::InterceptNavigationDelegate::CreateThrottleFor(
+ navigation_handle)
+ .Pass());
+ }
+ return throttles.Pass();
+}
+
#if defined(VIDEO_HOLE)
content::ExternalVideoSurfaceContainer*
AwContentBrowserClient::OverrideCreateExternalVideoSurfaceContainer(

Powered by Google App Engine
This is Rietveld 408576698