diff options
author | mkosiba@chromium.org <mkosiba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-24 10:07:56 +0000 |
---|---|---|
committer | mkosiba@chromium.org <mkosiba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-24 10:07:56 +0000 |
commit | 5c8453994c3fe90856adf357342e70916b52b496 (patch) | |
tree | 0baeb233ec3e35da4379a12456a3a48d5dcf987b /android_webview/java | |
parent | 74f05e5f6b235f4d6ab81af8aa5a855ffea46def (diff) | |
download | chromium_src-5c8453994c3fe90856adf357342e70916b52b496.zip chromium_src-5c8453994c3fe90856adf357342e70916b52b496.tar.gz chromium_src-5c8453994c3fe90856adf357342e70916b52b496.tar.bz2 |
[android_webview] Support intercepting for unhandled schemes.
This makes it possible to intercept navigations and resource requests
for otherwise unsupported schemes.
BUG=156354,148369
Review URL: https://codereview.chromium.org/11185051
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@163804 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'android_webview/java')
-rw-r--r-- | android_webview/java/src/org/chromium/android_webview/AwContentsClient.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContentsClient.java b/android_webview/java/src/org/chromium/android_webview/AwContentsClient.java index 87fda07..9cd3ba6 100644 --- a/android_webview/java/src/org/chromium/android_webview/AwContentsClient.java +++ b/android_webview/java/src/org/chromium/android_webview/AwContentsClient.java @@ -13,6 +13,7 @@ import android.webkit.ConsoleMessage; import org.chromium.content.browser.ContentViewClient; import org.chromium.content.browser.ContentViewCore; import org.chromium.content.browser.WebContentsObserverAndroid; +import org.chromium.net.NetError; /** * Base-class that an AwContents embedder derives from to receive callbacks. @@ -119,6 +120,19 @@ public abstract class AwContentsClient extends ContentViewClient { @Override public void didFailLoad(boolean isProvisionalLoad, boolean isMainFrame, int errorCode, String description, String failingUrl) { + if (errorCode == NetError.ERR_ABORTED) { + // This error code is generated for the following reasons: + // - WebView.stopLoading is called, + // - the navigation is intercepted by the embedder via shouldIgnoreNavigation. + // + // The Android WebView does not notify the embedder of these situations using this + // error code with the WebViewClient.onReceivedError callback. + return; + } + if (!isMainFrame) { + // The Android WebView does not notify the embedder of sub-frame failures. + return; + } AwContentsClient.this.onReceivedError( ErrorCodeConversionHelper.convertErrorCode(errorCode), description, failingUrl); } |