summaryrefslogtreecommitdiffstats
path: root/chrome/android
diff options
context:
space:
mode:
authornyquist@chromium.org <nyquist@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-28 01:24:12 +0000
committernyquist@chromium.org <nyquist@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-28 01:24:12 +0000
commitd289bd7f55ca3d3f647a0a2c6049115e0125b5df (patch)
tree87d1b6c64b2d775a5bf07fed9cb2e1fed94a76b1 /chrome/android
parentd2b20dd909486a7c78a76ddf0d0d13410c969ffe (diff)
downloadchromium_src-d289bd7f55ca3d3f647a0a2c6049115e0125b5df.zip
chromium_src-d289bd7f55ca3d3f647a0a2c6049115e0125b5df.tar.gz
chromium_src-d289bd7f55ca3d3f647a0a2c6049115e0125b5df.tar.bz2
Add support for distilling current WebContents
This CL adds the utilities needed for using the current WebContents when distilling web pages. BUG=361939 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=272611 Review URL: https://codereview.chromium.org/266073003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@273101 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/android')
-rw-r--r--chrome/android/java/src/org/chromium/chrome/browser/dom_distiller/DomDistillerTabUtils.java31
1 files changed, 31 insertions, 0 deletions
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/dom_distiller/DomDistillerTabUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/dom_distiller/DomDistillerTabUtils.java
new file mode 100644
index 0000000..ed76812
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/dom_distiller/DomDistillerTabUtils.java
@@ -0,0 +1,31 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chrome.browser.dom_distiller;
+
+import org.chromium.base.JNINamespace;
+import org.chromium.content_public.browser.WebContents;
+
+/**
+ * A helper class for using the DOM Distiller.
+ */
+@JNINamespace("android")
+public class DomDistillerTabUtils {
+
+ private DomDistillerTabUtils() {
+ }
+
+ /**
+ * Creates a new WebContents and navigates the {@link WebContents} to view the URL of the
+ * current page, while in the background starts distilling the current page. This method takes
+ * ownership over the old WebContents after swapping in the new one.
+ *
+ * @param webContents the WebContents to distill.
+ */
+ public static void distillCurrentPageAndView(WebContents webContents) {
+ nativeDistillCurrentPageAndView(webContents);
+ }
+
+ private static native void nativeDistillCurrentPageAndView(WebContents webContents);
+}