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

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

Issue 12620004: [android_webview] Fake onReceivedError callback for intercepted navigations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: make findbugs happy Created 7 years, 9 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/AwContentsClientCallbackHelper.java
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContentsClientCallbackHelper.java b/android_webview/java/src/org/chromium/android_webview/AwContentsClientCallbackHelper.java
index 84ce826022c1571186752e474fcc3b68503adee5..8dbd5713ff455849fe039acaf25f384781623a24 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContentsClientCallbackHelper.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContentsClientCallbackHelper.java
@@ -53,10 +53,23 @@ class AwContentsClientCallbackHelper {
}
}
+ private static class OnReceivedErrorInfo {
+ final int mErrorCode;
+ final String mDescription;
+ final String mFailingUrl;
+
+ OnReceivedErrorInfo(int errorCode, String description, String failingUrl) {
+ mErrorCode = errorCode;
+ mDescription = description;
+ mFailingUrl = failingUrl;
+ }
+ }
+
private final static int MSG_ON_LOAD_RESOURCE = 1;
private final static int MSG_ON_PAGE_STARTED = 2;
private final static int MSG_ON_DOWNLOAD_START = 3;
private final static int MSG_ON_RECEIVED_LOGIN_REQUEST = 4;
+ private final static int MSG_ON_RECEIVED_ERROR = 5;
private final AwContentsClient mContentsClient;
@@ -85,6 +98,12 @@ class AwContentsClientCallbackHelper {
mContentsClient.onReceivedLoginRequest(info.mRealm, info.mAccount, info.mArgs);
break;
}
+ case MSG_ON_RECEIVED_ERROR: {
+ OnReceivedErrorInfo info = (OnReceivedErrorInfo) msg.obj;
+ mContentsClient.onReceivedError(info.mErrorCode, info.mDescription,
+ info.mFailingUrl);
+ break;
+ }
default:
throw new IllegalStateException(
"AwContentsClientCallbackHelper: unhandled message " + msg.what);
@@ -115,4 +134,9 @@ class AwContentsClientCallbackHelper {
LoginRequestInfo info = new LoginRequestInfo(realm, account, args);
mHandler.sendMessage(mHandler.obtainMessage(MSG_ON_RECEIVED_LOGIN_REQUEST, info));
}
+
+ public void postOnReceivedError(int errorCode, String description, String failingUrl) {
+ OnReceivedErrorInfo info = new OnReceivedErrorInfo(errorCode, description, failingUrl);
+ mHandler.sendMessage(mHandler.obtainMessage(MSG_ON_RECEIVED_ERROR, info));
+ }
}

Powered by Google App Engine
This is Rietveld 408576698