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 eff9592f07db01ecd2f28483d440de7716d82d9c..f947060dad1e6866d7028536b807fcf8d09fab3a 100644 |
--- a/android_webview/java/src/org/chromium/android_webview/AwContents.java |
+++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java |
@@ -2954,10 +2954,22 @@ public class AwContents implements SmartClipProvider { |
* @return true if the WebView is visible |
*/ |
@VisibleForTesting |
+ @CalledByNative |
protected boolean canShowInterstitial() { |
return mIsAttachedToWindow && mIsViewVisible; |
} |
+ @CalledByNative |
+ private int getErrorUiType() { |
+ if (extendsOutOfWindow()) { |
+ return ErrorUiType.QUIET_GIANT; |
+ } else if (canShowBigInterstitial()) { |
+ return ErrorUiType.LOUD; |
+ } else { |
+ return ErrorUiType.QUIET_SMALL; |
+ } |
+ } |
+ |
/** |
* Determine if it's suitable to show the interstitial for browsers and main UIs. If the WebView |
* is close to full-screen, we assume the app is using it as the main UI, so we show the same |
@@ -2966,11 +2978,7 @@ public class AwContents implements SmartClipProvider { |
* @return true if the WebView should display the large interstitial |
*/ |
@VisibleForTesting |
- @CalledByNative |
protected boolean canShowBigInterstitial() { |
- if (!canShowInterstitial()) return false; |
- if (extendsOutOfWindow()) return false; |
- |
double percentOfScreenHeight = |
(double) mContainerView.getHeight() / mContainerView.getRootView().getHeight(); |