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

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

Issue 1001003004: [Android WebView] Implement a better OnReceivedError callback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed the last comment Created 5 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 73dd0c804d53716b121efff445ca2ad55b4f54b6..500d22c0806a197dbf57f69c791e9856f038b049 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContentsClientCallbackHelper.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContentsClientCallbackHelper.java
@@ -88,6 +88,7 @@ public class AwContentsClientCallbackHelper {
private static final int MSG_ON_NEW_PICTURE = 6;
private static final int MSG_ON_SCALE_CHANGED_SCALED = 7;
private static final int MSG_ON_RECEIVED_HTTP_ERROR = 8;
+ private static final int MSG_ON_PAGE_FINISHED = 9;
// Minimum period allowed between consecutive onNewPicture calls, to rate-limit the callbacks.
private static final long ON_NEW_PICTURE_MIN_PERIOD_MILLIS = 500;
@@ -157,6 +158,11 @@ public class AwContentsClientCallbackHelper {
mContentsClient.onReceivedHttpError(info.mRequest, info.mResponse);
break;
}
+ case MSG_ON_PAGE_FINISHED: {
+ final String url = (String) msg.obj;
+ mContentsClient.onPageFinished(url);
+ break;
+ }
default:
throw new IllegalStateException(
"AwContentsClientCallbackHelper: unhandled message " + msg.what);
@@ -219,4 +225,8 @@ public class AwContentsClientCallbackHelper {
new OnReceivedHttpErrorInfo(request, response);
mHandler.sendMessage(mHandler.obtainMessage(MSG_ON_RECEIVED_HTTP_ERROR, info));
}
+
+ public void postOnPageFinished(String url) {
+ mHandler.sendMessage(mHandler.obtainMessage(MSG_ON_PAGE_FINISHED, url));
+ }
}

Powered by Google App Engine
This is Rietveld 408576698