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

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

Issue 2735803003: [WebPayments] Extracting common code from Shipping + Contact Info views. (Closed)
Patch Set: monday rebase 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
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 a5ae9409a6046773a846e76ef0b1dbfadb39760d..39a5c2a42f57ceefac37c8f25c9c693701ed63ee 100644
--- a/chrome/browser/ui/views/payments/payment_sheet_view_controller.cc
+++ b/chrome/browser/ui/views/payments/payment_sheet_view_controller.cc
@@ -288,7 +288,7 @@ void PaymentSheetViewController::ButtonPressed(
break;
case static_cast<int>(PaymentSheetViewControllerTags::SHOW_SHIPPING_BUTTON):
- dialog()->ShowShippingListSheet();
+ dialog()->ShowShippingProfileSheet();
break;
case static_cast<int>(
@@ -298,7 +298,7 @@ void PaymentSheetViewController::ButtonPressed(
case static_cast<int>(
PaymentSheetViewControllerTags::SHOW_CONTACT_INFO_BUTTON):
- dialog()->ShowContactInfoSheet();
+ dialog()->ShowContactProfileSheet();
break;
default:
@@ -397,10 +397,8 @@ std::unique_ptr<views::View>
PaymentSheetViewController::CreateShippingSectionContent() {
auto* profile = request()->selected_shipping_profile();
- // TODO(tmartino): Empty string param is app locale; this should be passed
- // at construct-time and stored as a member in a future CL.
- return profile ? payments::GetShippingAddressLabel(AddressStyleType::SUMMARY,
- std::string(), *profile)
+ return profile ? payments::GetShippingAddressLabel(
+ AddressStyleType::SUMMARY, request()->locale(), *profile)
: base::MakeUnique<views::Label>(base::string16());
}
@@ -475,10 +473,12 @@ PaymentSheetViewController::CreatePaymentMethodRow() {
std::unique_ptr<views::View>
PaymentSheetViewController::CreateContactInfoSectionContent() {
auto* profile = request()->selected_contact_profile();
- // TODO(tmartino): Replace empty string with app locale.
- return profile ? payments::GetContactInfoLabel(AddressStyleType::SUMMARY,
- std::string(), *profile, true,
- true, true)
+
+ return profile ? payments::GetContactInfoLabel(
+ AddressStyleType::SUMMARY, request()->locale(), *profile,
+ request()->request_payer_name(),
+ request()->request_payer_phone(),
+ request()->request_payer_email())
: base::MakeUnique<views::Label>(base::string16());
}

Powered by Google App Engine
This is Rietveld 408576698