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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestSection.java

Issue 2271113002: Accept any string for currency code in PaymentRequest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed 640847 Created 4 years, 4 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/payments/ui/PaymentRequestSection.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestSection.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestSection.java
index d1639520b809c4e2a071c4053f27f8b8d4065ed4..939725e608495a557b10c101d0f4634bfb1aaf0d 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestSection.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestSection.java
@@ -528,6 +528,8 @@ public abstract class PaymentRequestSection extends LinearLayout implements View
*/
public static class LineItemBreakdownSection extends PaymentRequestSection {
private GridLayout mBreakdownLayout;
+ private static final int MAX_CURRENCY_CHARS = 6;
+ private static final String ELLIPSIS = "...";
please use gerrit instead 2016/08/25 16:47:38 Use the unicode ellipsis character: http://www.fil
pals 2016/08/26 07:20:26 If it is ok, I'll do the application related chang
please use gerrit instead 2016/08/26 17:01:37 OK. Since Samsung does not use Chromium's UI (as f
pals 2016/08/27 11:16:31 I'm working on it here https://codereview.chromium
public LineItemBreakdownSection(
Context context, String sectionName, SectionDelegate delegate) {
@@ -605,6 +607,9 @@ public abstract class PaymentRequestSection extends LinearLayout implements View
*/
private CharSequence createValueString(String currency, String value, boolean isValueBold) {
SpannableStringBuilder valueBuilder = new SpannableStringBuilder();
+ if (currency.length() > MAX_CURRENCY_CHARS) {
please use gerrit instead 2016/08/25 16:47:38 All currency formatting should happen in CurrencyS
+ currency = currency.substring(0, MAX_CURRENCY_CHARS) + ELLIPSIS;
please use gerrit instead 2016/08/25 16:47:38 currency = currency.substring(0, MAX_CURRENCY_CHAR
+ }
valueBuilder.append(currency);
valueBuilder.append(" ");

Powered by Google App Engine
This is Rietveld 408576698