Commit c466fa5d authored by Anthony Vallee-Dubois's avatar Anthony Vallee-Dubois Committed by Commit Bot

[WebPayments] Improve a11y label on order summary row

Bug: 848859
Change-Id: Ic242ff51351de2de5db6fd80e7f3d045b995eb04
Reviewed-on: https://chromium-review.googlesource.com/1082819
Commit-Queue: anthonyvd <anthonyvd@chromium.org>
Reviewed-by: default avatarMathieu Perreault <mathp@chromium.org>
Cr-Commit-Position: refs/heads/master@{#564911}
parent 1394523f
......@@ -634,19 +634,24 @@ PaymentSheetViewController::CreatePaymentSheetSummaryRow() {
std::unique_ptr<views::Label> total_label = CreateBoldLabel(total_label_text);
layout->AddView(total_label.release());
layout->AddView(
CreateInlineCurrencyAmountItem(
base::UTF8ToUTF16(spec()->GetFormattedCurrencyCode(
spec()->GetTotal(state()->selected_instrument())->amount)),
spec()->GetFormattedCurrencyAmount(
spec()->GetTotal(state()->selected_instrument())->amount),
false, true)
.release());
base::string16 total_currency_code =
base::UTF8ToUTF16(spec()->GetFormattedCurrencyCode(
spec()->GetTotal(state()->selected_instrument())->amount));
base::string16 total_amount = spec()->GetFormattedCurrencyAmount(
spec()->GetTotal(state()->selected_instrument())->amount);
layout->AddView(CreateInlineCurrencyAmountItem(total_currency_code,
total_amount, false, true)
.release());
PaymentSheetRowBuilder builder(
this, l10n_util::GetStringUTF16(IDS_PAYMENTS_ORDER_SUMMARY_LABEL));
builder.Tag(PaymentSheetViewControllerTags::SHOW_ORDER_SUMMARY_BUTTON)
.Id(DialogViewID::PAYMENT_SHEET_SUMMARY_SECTION);
.Id(DialogViewID::PAYMENT_SHEET_SUMMARY_SECTION)
.AccessibleContent(l10n_util::GetStringFUTF16(
IDS_PAYMENTS_ORDER_SUMMARY_ACCESSIBLE_LABEL,
l10n_util::GetStringFUTF16(
IDS_PAYMENT_REQUEST_ORDER_SUMMARY_SECTION_TOTAL_FORMAT,
total_label_text, total_currency_code, total_amount)));
return builder.CreateWithChevron(std::move(inline_summary), nullptr);
}
......
......@@ -631,4 +631,7 @@
<message name="IDS_PAYMENTS_ACCESSIBLE_LABEL_WITH_ERROR" desc="The format to append an error message to a screen reader string describing a profile or payment method">
<ph name="LABEL">$1<ex>Homer Simpson 123 Fake Street</ex></ph> <ph name="ERROR">$2<ex>Phone number required</ex></ph>
</message>
<message name="IDS_PAYMENTS_ORDER_SUMMARY_ACCESSIBLE_LABEL" desc="The string used to format what the screenreader reads out for the order summary section of the Payment Sheet.">
Order Summary, <ph name="TOTAL_LABEL">$1<ex>Total, USD $10.00</ex></ph>, More Details
</message>
</grit-part>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment