Chromium Code Reviews| Index: components/url_formatter/android/java/src/org/chromium/components/url_formatter/UrlFormatter.java |
| diff --git a/components/url_formatter/android/java/src/org/chromium/components/url_formatter/UrlFormatter.java b/components/url_formatter/android/java/src/org/chromium/components/url_formatter/UrlFormatter.java |
| index 98c394e171cb61b992dccbcae89efd445d0960b2..3d7ee1d73c729bb450b921176161db98f24f51dc 100644 |
| --- a/components/url_formatter/android/java/src/org/chromium/components/url_formatter/UrlFormatter.java |
| +++ b/components/url_formatter/android/java/src/org/chromium/components/url_formatter/UrlFormatter.java |
| @@ -4,7 +4,10 @@ |
| package org.chromium.components.url_formatter; |
| +import android.text.Spannable; |
| +import android.text.SpannableString; |
| import android.text.TextUtils; |
| +import android.text.style.ForegroundColorSpan; |
| import org.chromium.base.annotations.JNINamespace; |
| @@ -83,6 +86,21 @@ public final class UrlFormatter { |
| } |
| } |
| + /** |
| + * Tints the scheme of the URL to specific color for display. |
| + * |
| + * @param uri The URI. |
|
please use gerrit instead
2017/02/15 21:45:02
Please align "The" together on these two lines.
gogerald1
2017/02/16 16:43:14
Done.
|
| + * @param color The color used to tint the scheme. |
| + * |
| + * @return The URL with tinted scheme. |
| + */ |
| + public static CharSequence tintUrlSchemeForSecurityDisplay(String uri, int color) { |
|
please use gerrit instead
2017/02/15 21:45:02
How does the omnibox tint the URL scheme? It would
please use gerrit instead
2017/02/15 21:45:02
Please pick either URL or URI and use that term th
gogerald1
2017/02/16 16:43:14
Done.
gogerald1
2017/02/16 16:43:14
They do the similar thing.
|
| + SpannableString spannableUri = new SpannableString(uri); |
| + spannableUri.setSpan(new ForegroundColorSpan(color), 0, |
| + spannableUri.toString().indexOf(":"), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); |
|
please use gerrit instead
2017/02/15 21:45:02
Please tint only "https:" scheme. Although "file:"
gogerald1
2017/02/16 16:43:14
Done.
|
| + return spannableUri; |
| + } |
| + |
| private static native String nativeFixupUrl(String url); |
| private static native String nativeFormatUrlForDisplay(String url); |
| private static native String nativeFormatUrlForSecurityDisplay(String url); |