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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.components.dom_distiller.content; 5 package org.chromium.components.dom_distiller.content;
6 6
7 import org.chromium.base.annotations.CalledByNative; 7 import org.chromium.base.annotations.CalledByNative;
8 import org.chromium.base.annotations.JNINamespace; 8 import org.chromium.base.annotations.JNINamespace;
9 import org.chromium.content_public.browser.WebContents; 9 import org.chromium.content_public.browser.WebContents;
10 10
(...skipping 15 matching lines...) Expand all
26 } 26 }
27 27
28 @CalledByNative 28 @CalledByNative
29 private static void callOnIsPageDistillableResult( 29 private static void callOnIsPageDistillableResult(
30 PageDistillableCallback callback, boolean isDistillable) { 30 PageDistillableCallback callback, boolean isDistillable) {
31 callback.onIsPageDistillableResult(isDistillable); 31 callback.onIsPageDistillableResult(isDistillable);
32 } 32 }
33 33
34 private static native void nativeIsPageDistillable( 34 private static native void nativeIsPageDistillable(
35 WebContents webContents, boolean isMobileOptimized, PageDistillableC allback callback); 35 WebContents webContents, boolean isMobileOptimized, PageDistillableC allback callback);
36
37 /**
38 * Delegate to receive distillability updates.
39 */
40 public static interface PageDistillableDelegate {
41 public void onIsPageDistillableResult(boolean isDistillable, boolean isL ast);
mdjones 2015/11/12 23:46:48 Nit: javadoc for public interface.
wychen 2015/11/13 01:55:12 Done.
42 }
43
44 public static void setDelegate(WebContents webContents,
45 PageDistillableDelegate delegate) {
46 nativeSetDelegate(webContents, delegate);
47 }
48
49 @CalledByNative
50 private static void callOnIsPageDistillableUpdate(
51 PageDistillableDelegate delegate, boolean isDistillable, boolean isL ast) {
52 delegate.onIsPageDistillableResult(isDistillable, isLast);
53 }
54
55 private static native void nativeSetDelegate(
56 WebContents webContents, PageDistillableDelegate delegate);
36 } 57 }
37
OLDNEW
« 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