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

Unified Diff: components/dom_distiller/android/java/src/org/chromium/components/dom_distiller/content/DistillablePageUtils.java

Issue 1414283006: Hook up new distillability signal to DistillablePageUtils (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@agent
Patch Set: merge depend Created 5 years, 1 month 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: 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);
+}
« no previous file with comments | « chrome/test/data/dom_distiller/simple_article.html ('k') | components/dom_distiller/content/browser/distillable_page_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698