| Index: components/dom_distiller/android/java/src/org/chromium/components/dom_distiller/content/DistillablePageUtils.java
|
| diff --git a/components/dom_distiller/android/java/src/org/chromium/components/dom_distiller/content/DistillablePageUtils.java b/components/dom_distiller/android/java/src/org/chromium/components/dom_distiller/content/DistillablePageUtils.java
|
| index 0f7c794f5c0563b8ade4b8b985593851727e547e..959a71be6ee8d418ec4a743253eb8d4d22a5669a 100644
|
| --- a/components/dom_distiller/android/java/src/org/chromium/components/dom_distiller/content/DistillablePageUtils.java
|
| +++ b/components/dom_distiller/android/java/src/org/chromium/components/dom_distiller/content/DistillablePageUtils.java
|
| @@ -33,5 +33,30 @@ public final class DistillablePageUtils {
|
|
|
| private static native void nativeIsPageDistillable(
|
| WebContents webContents, boolean isMobileOptimized, PageDistillableCallback callback);
|
| -}
|
|
|
| + /**
|
| + * Delegate to receive distillability updates.
|
| + */
|
| + public static interface PageDistillableDelegate {
|
| + /**
|
| + * Called when the distillability status changes.
|
| + * @param isDistillable Whether the page is distillable.
|
| + * @param isLast Whether the update is the last one for this page.
|
| + */
|
| + public void onIsPageDistillableResult(boolean isDistillable, boolean isLast);
|
| + }
|
| +
|
| + public static void setDelegate(WebContents webContents,
|
| + PageDistillableDelegate delegate) {
|
| + nativeSetDelegate(webContents, delegate);
|
| + }
|
| +
|
| + @CalledByNative
|
| + private static void callOnIsPageDistillableUpdate(
|
| + PageDistillableDelegate delegate, boolean isDistillable, boolean isLast) {
|
| + delegate.onIsPageDistillableResult(isDistillable, isLast);
|
| + }
|
| +
|
| + private static native void nativeSetDelegate(
|
| + WebContents webContents, PageDistillableDelegate delegate);
|
| +}
|
|
|