Chromium Code Reviews| 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..04f5aa58912e0eec9fe5c9a7a00ebc2ba5cdd2e5 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,25 @@ public final class DistillablePageUtils { |
| private static native void nativeIsPageDistillable( |
| WebContents webContents, boolean isMobileOptimized, PageDistillableCallback callback); |
| -} |
| + /** |
| + * Delegate to receive distillability updates. |
| + */ |
| + public static interface PageDistillableDelegate { |
| + public void onIsPageDistillableResult(boolean isDistillable, boolean isLast); |
|
mdjones
2015/11/12 23:46:48
Nit: javadoc for public interface.
wychen
2015/11/13 01:55:12
Done.
|
| + } |
| + |
| + 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); |
| +} |