Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(484)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/UrlUtilities.java

Issue 1426453003: Notification custom layouts: improve origin display. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/android/java/src/org/chromium/chrome/browser/UrlUtilities.java
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 27ed1dd7db83ca38abe37651a44f790ccc07194d..6665a28d05496d827e8ec7c97fde75736a6b5d68 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/UrlUtilities.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/UrlUtilities.java
@@ -140,7 +140,7 @@ public static String fixupUrl(String uri) {
}
/**
- * Builds a String that strips down the URL to the its scheme, host, and port.
+ * Builds a String that strips down the URL to 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
* is ignored.
@@ -148,13 +148,24 @@ public static String fixupUrl(String uri) {
* it fails to parse it.
*/
public static String formatUrlForSecurityDisplay(URI uri, boolean showScheme) {
+ return formatUrlForSecurityDisplay(uri.toString(), showScheme);
+ }
+
+ /**
+ * Builds a String that strips down |url| to its scheme, host, and port.
+ * @param uri The URI to break down.
+ * @param showScheme Whether or not to show the scheme. If the URL can't be parsed, this value
+ * is ignored.
+ * @return Stripped-down String containing the essential bits of the URL, or the original URL if
+ * it fails to parse it.
+ */
+ public static String formatUrlForSecurityDisplay(String uri, boolean showScheme) {
if (showScheme) {
- return nativeFormatUrlForSecurityDisplay(uri.toString());
+ return nativeFormatUrlForSecurityDisplay(uri);
} else {
- return nativeFormatUrlForSecurityDisplayOmitScheme(uri.toString());
+ return nativeFormatUrlForSecurityDisplayOmitScheme(uri);
}
}
-
/**
* Determines whether or not the given URLs belong to the same broad domain or host.
* "Broad domain" is defined as the TLD + 1 or the host.

Powered by Google App Engine
This is Rietveld 408576698