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

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

Issue 1248643004: Test distillability without JavaScript (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@early
Patch Set: fix browsertest, merge webkit CL, merge http://crrev.com/1403413004 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
« no previous file with comments | « components/dom_distiller/DEPS ('k') | components/dom_distiller/content/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
11 /** 11 /**
12 * Provides access to the native dom_distiller::IsPageDistillable function. 12 * Provides access to the native dom_distiller::IsPageDistillable function.
13 */ 13 */
14 @JNINamespace("dom_distiller::android") 14 @JNINamespace("dom_distiller::android")
15 public final class DistillablePageUtils { 15 public final class DistillablePageUtils {
16 /** 16 /**
17 * Callback for handling the result of isPageDistillable. 17 * Callback for handling the result of isPageDistillable.
18 */ 18 */
19 public static interface PageDistillableCallback { 19 public static interface PageDistillableCallback {
20 public void onIsPageDistillableResult(boolean isDistillable); 20 public void onIsPageDistillableResult(boolean isDistillable, boolean isL ast);
21 } 21 }
22 22
23 public static void isPageDistillable(WebContents webContents, boolean isMobi leOptimized, 23 public static void setCallback(WebContents webContents,
24 PageDistillableCallback callback) { 24 PageDistillableCallback callback) {
25 nativeIsPageDistillable(webContents, isMobileOptimized, callback); 25 nativeSetCallback(webContents, callback);
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, boolean isL ast) {
31 callback.onIsPageDistillableResult(isDistillable); 31 callback.onIsPageDistillableResult(isDistillable, isLast);
32 } 32 }
33 33
34 private static native void nativeIsPageDistillable( 34 private static native void nativeSetCallback(
35 WebContents webContents, boolean isMobileOptimized, PageDistillableC allback callback); 35 WebContents webContents, PageDistillableCallback callback);
36 } 36 }
37
OLDNEW
« no previous file with comments | « components/dom_distiller/DEPS ('k') | components/dom_distiller/content/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698