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

Unified Diff: android_webview/native/aw_contents.cc

Issue 10946008: Componentize IgnoreNavigationResourceThrottle and add chrome and webview specific implementations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed presubmit warning for jni_generator.py Created 8 years, 2 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/native/aw_contents.cc
diff --git a/android_webview/native/aw_contents.cc b/android_webview/native/aw_contents.cc
index 257ea51b175b1f19e61e3654923196461a83bda8..cc6902461c047930630cedb6cd44c2837011aff4 100644
--- a/android_webview/native/aw_contents.cc
+++ b/android_webview/native/aw_contents.cc
@@ -16,6 +16,7 @@
#include "base/bind.h"
#include "base/callback.h"
#include "base/supports_user_data.h"
+#include "chrome/browser/component/navigation_interception/intercept_navigation_delegate.h"
#include "content/public/browser/android/content_view_core.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/cert_store.h"
@@ -36,6 +37,7 @@ using base::android::ScopedJavaLocalRef;
using content::BrowserThread;
using content::ContentViewCore;
using content::WebContents;
+using navigation_interception::InterceptNavigationDelegate;
namespace android_webview {
@@ -219,6 +221,16 @@ void AwContents::SetIoThreadClient(JNIEnv* env, jobject obj, jobject client) {
web_contents, ScopedJavaLocalRef<jobject>(env, client));
}
+void AwContents::SetInterceptNavigationDelegate(JNIEnv* env,
+ jobject obj,
+ jobject delegate) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ content::WebContents* web_contents = contents_container_->GetWebContents();
+ InterceptNavigationDelegate::Associate(
+ web_contents,
+ make_scoped_ptr(new InterceptNavigationDelegate(env, delegate)));
+}
+
static jint Init(JNIEnv* env,
jobject obj,
jobject web_contents_delegate,

Powered by Google App Engine
This is Rietveld 408576698