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

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: moved jni to component, added Java test code 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 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,

Powered by Google App Engine
This is Rietveld 408576698