summaryrefslogtreecommitdiffstats
path: root/chrome/android
diff options
context:
space:
mode:
authorkkimlabs@chromium.org <kkimlabs@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-27 03:47:18 +0000
committerkkimlabs@chromium.org <kkimlabs@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-27 03:47:18 +0000
commitf72879c625e0a38dbc6ae458a7dcc0228eba004a (patch)
tree30912dec3d2e0fe3edda6f05313cb54d79e049fa /chrome/android
parent31f567744853cda4af9fbe0c6e253396ec651f8d (diff)
downloadchromium_src-f72879c625e0a38dbc6ae458a7dcc0228eba004a.zip
chromium_src-f72879c625e0a38dbc6ae458a7dcc0228eba004a.tar.gz
chromium_src-f72879c625e0a38dbc6ae458a7dcc0228eba004a.tar.bz2
[Android] URLFixerUpper::FixupURL(...) JNI binding for homepage url fixup.
BUG=318901 Review URL: https://codereview.chromium.org/75303003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237495 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/android')
-rw-r--r--chrome/android/java/src/org/chromium/chrome/browser/UrlUtilities.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/UrlUtilities.java b/chrome/android/java/src/org/chromium/chrome/browser/UrlUtilities.java
index 6bcb74b..00c6347 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/UrlUtilities.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/UrlUtilities.java
@@ -110,6 +110,19 @@ public class UrlUtilities {
}
/**
+ * Refer to UrlFixerUpper::FixupURL.
+ *
+ * Compare to {@link #fixUrl(String)}, This fixes URL more aggressively including Chrome
+ * specific cases. For example, "about:" becomes "chrome://version/". However, this is not a
+ * superset of {@link #fixUrl(String)} either. For example, this function doesn't do anything
+ * with "://mail.google.com:/", while the other one prepends "http". Also, for
+ * "//mail.google.com:/", this function prepends "file" while the other one prepends "http".
+ */
+ public static String fixupUrl(String uri) {
+ return nativeFixupUrl(uri, null);
+ }
+
+ /**
* Builds a String that strips down the URL to the its scheme, host, and port.
* @param uri URI to break down.
* @param showScheme Whether or not to show the scheme. If the URL can't be parsed, this value
@@ -190,4 +203,5 @@ public class UrlUtilities {
boolean includePrivateRegistries);
public static native boolean nativeIsGoogleSearchUrl(String url);
public static native boolean nativeIsGoogleHomePageUrl(String url);
+ public static native String nativeFixupUrl(String url, String desiredTld);
}