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

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

Issue 1155713005: Use a resource throttle to implement shouldOverrideUrlLoading. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and fix qinmin nit Created 5 years, 5 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/AwWebContentsObserver.java
diff --git a/android_webview/java/src/org/chromium/android_webview/AwWebContentsObserver.java b/android_webview/java/src/org/chromium/android_webview/AwWebContentsObserver.java
index 85cf90ce03c7c53559c978b64724d96c045e606f..53715c67b5f8c6d520ee8ec445e1054c31c8abbc 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwWebContentsObserver.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwWebContentsObserver.java
@@ -53,9 +53,13 @@ public class AwWebContentsObserver extends WebContentsObserver {
String unreachableWebDataUrl = AwContentsStatics.getUnreachableWebDataUrl();
boolean isErrorUrl =
unreachableWebDataUrl != null && unreachableWebDataUrl.equals(failingUrl);
- if (isMainFrame && !isErrorUrl && errorCode == NetError.ERR_ABORTED) {
+ if (isMainFrame && !isErrorUrl && errorCode == NetError.ERR_ABORTED
+ && !wasIgnoredByHandler) {
// Need to call onPageFinished for backwards compatibility with the classic webview.
// See also AwContents.IoThreadClientImpl.onReceivedError.
+ // If the navigation was ignored because of shouldOverrideUrlLoading we have already
+ // called onPageFinished in
+ // AwContents.InterceptNavigationDelegateImpl.shouldIgnoreNavigation instead.
client.getCallbackHelper().postOnPageFinished(failingUrl);
}
}

Powered by Google App Engine
This is Rietveld 408576698