ed768127dff74ab673870f4b54688167f0edf23b
[platform/framework/web/crosswalk.git] / src / chrome / android / java / src / org / chromium / chrome / browser / dom_distiller / DomDistillerTabUtils.java
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 package org.chromium.chrome.browser.dom_distiller;
6
7 import org.chromium.base.JNINamespace;
8 import org.chromium.content_public.browser.WebContents;
9
10 /**
11  * A helper class for using the DOM Distiller.
12  */
13 @JNINamespace("android")
14 public class DomDistillerTabUtils {
15
16     private DomDistillerTabUtils() {
17     }
18
19     /**
20      * Creates a new WebContents and navigates the {@link WebContents} to view the URL of the
21      * current page, while in the background starts distilling the current page. This method takes
22      * ownership over the old WebContents after swapping in the new one.
23      *
24      * @param webContents the WebContents to distill.
25      */
26     public static void distillCurrentPageAndView(WebContents webContents) {
27         nativeDistillCurrentPageAndView(webContents);
28     }
29
30     private static native void nativeDistillCurrentPageAndView(WebContents webContents);
31 }