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

Unified Diff: chrome/browser/ui/views/payments/order_summary_view_controller.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 | « no previous file | chrome/browser/ui/views/payments/payment_request_views_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/payments/order_summary_view_controller.cc
diff --git a/chrome/browser/ui/views/payments/order_summary_view_controller.cc b/chrome/browser/ui/views/payments/order_summary_view_controller.cc
index c2dc0896baaa3e69459de1206aff58c5e08617f5..15503c2403ed4c937ff84576d969bce322c21fa2 100644
--- a/chrome/browser/ui/views/payments/order_summary_view_controller.cc
+++ b/chrome/browser/ui/views/payments/order_summary_view_controller.cc
@@ -6,6 +6,7 @@
#include <memory>
#include <utility>
+#include <vector>
#include "base/logging.h"
#include "base/memory/ptr_util.h"
@@ -102,11 +103,6 @@ std::unique_ptr<views::View> OrderSummaryViewController::CreateView() {
views::BoxLayout::CROSS_AXIS_ALIGNMENT_STRETCH);
content_view->SetLayoutManager(layout);
- CurrencyFormatter* formatter = request()->GetOrCreateCurrencyFormatter(
- request()->details()->total->amount->currency,
- request()->details()->total->amount->currency_system,
- g_browser_process->GetApplicationLocale());
-
// Set the ID for the first few line items labels, for testing.
const std::vector<DialogViewID> line_items{
DialogViewID::ORDER_SUMMARY_LINE_ITEM_1,
@@ -118,7 +114,7 @@ std::unique_ptr<views::View> OrderSummaryViewController::CreateView() {
content_view->AddChildView(
CreateLineItemView(
base::UTF8ToUTF16(request()->details()->display_items[i]->label),
- formatter->Format(
+ request()->GetFormattedCurrencyAmount(
request()->details()->display_items[i]->amount->value),
false, view_id)
.release());
@@ -127,7 +123,8 @@ std::unique_ptr<views::View> OrderSummaryViewController::CreateView() {
base::string16 total_label_value = l10n_util::GetStringFUTF16(
IDS_PAYMENT_REQUEST_ORDER_SUMMARY_SHEET_TOTAL_FORMAT,
base::UTF8ToUTF16(request()->details()->total->amount->currency),
- formatter->Format(request()->details()->total->amount->value));
+ request()->GetFormattedCurrencyAmount(
+ request()->details()->total->amount->value));
content_view->AddChildView(
CreateLineItemView(base::UTF8ToUTF16(request()->details()->total->label),
« no previous file with comments | « no previous file | chrome/browser/ui/views/payments/payment_request_views_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698