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

Unified Diff: components/payments/content/payment_request.cc

Issue 2730123002: [Web Payments] Add inline items to the Order Summary section. (Closed)
Patch Set: Address comments. Created 3 years, 9 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
« no previous file with comments | « components/payments/content/payment_request.h ('k') | components/payments_strings.grdp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/payments/content/payment_request.cc
diff --git a/components/payments/content/payment_request.cc b/components/payments/content/payment_request.cc
index e55e68b272a5ec75112dfe572c94fadd4b8f4389..613bff17b6c79a3c6d14b32facd805f16cac8557 100644
--- a/components/payments/content/payment_request.cc
+++ b/components/payments/content/payment_request.cc
@@ -135,6 +135,24 @@ CurrencyFormatter* PaymentRequest::GetOrCreateCurrencyFormatter(
return currency_formatter_.get();
}
+base::string16 PaymentRequest::GetFormattedCurrencyAmount(
+ const std::string& amount) {
+ CurrencyFormatter* formatter =
+ GetOrCreateCurrencyFormatter(details()->total->amount->currency,
+ details()->total->amount->currency_system,
+ delegate_->GetApplicationLocale());
+ return formatter->Format(amount);
+}
+
+std::string PaymentRequest::GetFormattedCurrencyCode() {
+ CurrencyFormatter* formatter =
+ GetOrCreateCurrencyFormatter(details()->total->amount->currency,
+ details()->total->amount->currency_system,
+ delegate_->GetApplicationLocale());
+
+ return formatter->formatted_currency_code();
+}
+
void PaymentRequest::SetSelectedShippingProfile(
autofill::AutofillProfile* profile) {
selected_shipping_profile_ = profile;
« no previous file with comments | « components/payments/content/payment_request.h ('k') | components/payments_strings.grdp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698