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

Unified Diff: android_webview/java/src/org/chromium/android_webview/AwContents.java

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/java/src/org/chromium/android_webview/AwContents.java
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContents.java b/android_webview/java/src/org/chromium/android_webview/AwContents.java
index 67848b0596c8c7ca7fadf25fa29f67fab776c5dc..377e568711bfa966d697b8de9953da2ed4a4fd95 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContents.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
@@ -16,6 +16,7 @@ import android.webkit.ValueCallback;
import org.chromium.base.CalledByNative;
import org.chromium.base.JNINamespace;
import org.chromium.base.ThreadUtils;
+import org.chromium.chrome.browser.component.navigation_interception.InterceptNavigationDelegate;
import org.chromium.content.browser.ContentViewCore;
import org.chromium.content.browser.NavigationHistory;
import org.chromium.content.common.CleanupReference;
@@ -48,6 +49,7 @@ public class AwContents {
private ContentViewCore mContentViewCore;
private AwContentsClient mContentsClient;
private AwContentsIoThreadClient mIoThreadClient;
+ private InterceptNavigationDelegate mInterceptNavigationDelegate;
// This can be accessed on any thread after construction. See AwContentsIoThreadClient.
private final AwSettings mSettings;
@@ -78,6 +80,13 @@ public class AwContents {
}
}
+ private class InterceptNavigationDelegateImpl implements InterceptNavigationDelegate {
+ @Override
+ public boolean shouldIgnoreNavigation(String url, boolean isUserGestrue) {
+ return AwContents.this.mContentsClient.shouldIgnoreNavigation(url);
+ }
+ }
+
/**
* @param containerView the view-hierarchy item this object will be bound to.
* @param internalAccessAdapter to access private methods on containerView.
@@ -105,6 +114,7 @@ public class AwContents {
mSettings = new AwSettings(mContentViewCore.getContext());
setIoThreadClient(new IoThreadClientImpl());
+ setInterceptNavigationDelegate(new InterceptNavigationDelegateImpl());
}
public ContentViewCore getContentViewCore() {
@@ -121,6 +131,11 @@ public class AwContents {
nativeSetIoThreadClient(mNativeAwContents, mIoThreadClient);
}
+ public void setInterceptNavigationDelegate(InterceptNavigationDelegate delegate) {
+ mInterceptNavigationDelegate = delegate;
+ nativeSetInterceptNavigationDelegate(mNativeAwContents, delegate);
+ }
+
public void destroy() {
if (mContentViewCore != null) {
mContentViewCore.destroy();
@@ -363,6 +378,8 @@ public class AwContents {
private native void nativeSetIoThreadClient(int nativeAwContents,
AwContentsIoThreadClient ioThreadClient);
+ private native void nativeSetInterceptNavigationDelegate(int nativeAwContents,
+ InterceptNavigationDelegate navigationInterceptionDelegate);
private native int nativeFindAllSync(int nativeAwContents, String searchString);
private native void nativeFindAllAsync(int nativeAwContents, String searchString);

Powered by Google App Engine
This is Rietveld 408576698