Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 | |
| OLD | NEW |