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

Unified Diff: components/url_formatter/android/java/src/org/chromium/components/url_formatter/UrlFormatter.java

Issue 2698703003: [Payments] Add UI elements to secure branding for payments (Closed)
Patch Set: Address comments, fix animation and improve efficiency Created 3 years, 10 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: 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..4cd8450a284a6609f2a472ccfae1ed0f2aff3937 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 URI to specific color for display.
+ *
+ * @param uri The URI.
+ * @param color The color used to tint the scheme.
+ *
gone 2017/02/16 19:18:57 No newline on 94.
gogerald1 2017/02/17 00:44:46 Done.
+ * @return The URI with tinted scheme.
+ */
+ public static CharSequence tintUrlSchemeForSecurityDisplay(String uri, int color) {
gone 2017/02/16 19:18:57 Find another place for this. The new code is Paym
gogerald1 2017/02/17 00:44:46 Done.
+ SpannableString spannableUri = new SpannableString(uri);
+ spannableUri.setSpan(new ForegroundColorSpan(color), 0,
+ spannableUri.toString().indexOf(":"), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
+ return spannableUri;
+ }
+
private static native String nativeFixupUrl(String url);
private static native String nativeFormatUrlForDisplay(String url);
private static native String nativeFormatUrlForSecurityDisplay(String url);

Powered by Google App Engine
This is Rietveld 408576698