| Index: android_webview/native/aw_contents.cc
|
| diff --git a/android_webview/native/aw_contents.cc b/android_webview/native/aw_contents.cc
|
| index f3005a3421d4ec7e8d7813d86a251e0f6bdb0a9c..a1db3685fb2bfc4fbb8ba53f657e1e98061821ee 100644
|
| --- a/android_webview/native/aw_contents.cc
|
| +++ b/android_webview/native/aw_contents.cc
|
| @@ -15,6 +15,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/web_contents.h"
|
| @@ -31,6 +32,7 @@ using base::android::ScopedJavaLocalRef;
|
| using content::BrowserThread;
|
| using content::ContentViewCore;
|
| using content::WebContents;
|
| +using navigation_interception::InterceptNavigationDelegate;
|
|
|
| namespace android_webview {
|
|
|
| @@ -100,6 +102,10 @@ void AwContents::Destroy(JNIEnv* env, jobject obj) {
|
| delete this;
|
| }
|
|
|
| +AwWebContentsDelegate* AwContents::GetAwWebContentsDelegate() const {
|
| + return web_contents_delegate_.get();
|
| +}
|
| +
|
| namespace {
|
| // |message| is passed as base::Owned, so it will automatically be deleted
|
| // when the callback goes out of scope.
|
| @@ -214,6 +220,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,
|
|
|