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

Unified Diff: chrome/browser/ui/views/payments/payment_sheet_view_controller.cc

Issue 2725963002: [Payments] Only show the required rows in the Payment Request dialog (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | chrome/browser/ui/views/payments/payment_sheet_view_controller_interactive_uitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/payments/payment_sheet_view_controller.cc
diff --git a/chrome/browser/ui/views/payments/payment_sheet_view_controller.cc b/chrome/browser/ui/views/payments/payment_sheet_view_controller.cc
index d3ce2d54890d77e9169ae11c24cd0321f4cd462b..13682a389ef7655a750dbdcecdd28fbea5dae9f2 100644
--- a/chrome/browser/ui/views/payments/payment_sheet_view_controller.cc
+++ b/chrome/browser/ui/views/payments/payment_sheet_view_controller.cc
@@ -184,14 +184,20 @@ std::unique_ptr<views::View> PaymentSheetViewController::CreateView() {
columns->AddColumn(views::GridLayout::FILL, views::GridLayout::CENTER,
1, views::GridLayout::USE_PREF, 0, 0);
+ // The shipping address and contact info rows are optional.
layout->StartRow(0, 0);
layout->AddView(CreatePaymentSheetSummaryRow().release());
- layout->StartRow(1, 0);
- layout->AddView(CreateShippingRow().release());
+ if (request()->request_shipping()) {
+ layout->StartRow(1, 0);
+ layout->AddView(CreateShippingRow().release());
+ }
layout->StartRow(0, 0);
layout->AddView(CreatePaymentMethodRow().release());
- layout->StartRow(1, 0);
- layout->AddView(CreateContactInfoRow().release());
+ if (request()->request_payer_name() || request()->request_payer_email() ||
+ request()->request_payer_phone()) {
+ layout->StartRow(1, 0);
+ layout->AddView(CreateContactInfoRow().release());
+ }
return CreatePaymentView(
CreateSheetHeaderView(
« no previous file with comments | « no previous file | chrome/browser/ui/views/payments/payment_sheet_view_controller_interactive_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698