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.
5 package org.chromium.components.dom_distiller.core;
7 import org.chromium.base.JNINamespace;
10 * Wrapper for the dom_distiller::url_utils.
12 @JNINamespace("dom_distiller::url_utils::android")
13 public final class DomDistillerUrlUtils {
15 private DomDistillerUrlUtils() {
19 * Returns the URL for viewing distilled content for a URL.
21 * @param scheme The scheme for the DOM Distiller source.
22 * @param url The URL to distill.
23 * @return the URL to load to get the distilled version of a page.
25 public static String getDistillerViewUrlFromUrl(String scheme, String url) {
26 return nativeGetDistillerViewUrlFromUrl(scheme, url);
30 * Returns the original URL of a distillation given the viewer URL.
32 * @param url The current viewer URL.
33 * @return the URL of the original page.
35 public static String getOriginalUrlFromDistillerUrl(String url) {
36 return nativeGetOriginalUrlFromDistillerUrl(url);
39 public static boolean isUrlReportable(String scheme, String url) {
40 return nativeIsUrlReportable(scheme, url);
43 private static native String nativeGetDistillerViewUrlFromUrl(String scheme, String url);
44 private static native String nativeGetOriginalUrlFromDistillerUrl(String viewerUrl);
45 private static native boolean nativeIsUrlReportable(String scheme, String url);