Chromium Code Reviews| Index: chrome/browser/ui/views/payments/payment_request_views_util.cc |
| diff --git a/chrome/browser/ui/views/payments/payment_request_views_util.cc b/chrome/browser/ui/views/payments/payment_request_views_util.cc |
| index 6e110bbe539c4077867de92cee6de80ed838e7b5..6dab3b3c68d804775e175c1f66f5a6361b208c24 100644 |
| --- a/chrome/browser/ui/views/payments/payment_request_views_util.cc |
| +++ b/chrome/browser/ui/views/payments/payment_request_views_util.cc |
| @@ -15,7 +15,9 @@ |
| #include "components/autofill/core/browser/autofill_type.h" |
| #include "components/autofill/core/browser/credit_card.h" |
| #include "components/autofill/core/browser/field_types.h" |
| +#include "components/strings/grit/components_strings.h" |
| #include "third_party/skia/include/core/SkColor.h" |
| +#include "ui/base/l10n/l10n_util.h" |
| #include "ui/base/resource/resource_bundle.h" |
| #include "ui/gfx/canvas.h" |
| #include "ui/gfx/font_list.h" |
| @@ -246,4 +248,24 @@ std::unique_ptr<views::Label> CreateBoldLabel(const base::string16& text) { |
| return label; |
| } |
| +base::string16 GetShippingAddressSectionString( |
| + const payments::mojom::PaymentShippingType& shipping_type) { |
| + if (shipping_type == payments::mojom::PaymentShippingType::DELIVERY) |
|
Mathieu
2017/03/10 20:47:29
Could we have a switch(shipping_type) with three c
anthonyvd
2017/03/10 20:58:53
Good point, I set it up like this when I was confu
|
| + return l10n_util::GetStringUTF16(IDS_PAYMENTS_DELIVERY_ADDRESS_LABEL); |
| + if (shipping_type == payments::mojom::PaymentShippingType::PICKUP) |
| + return l10n_util::GetStringUTF16(IDS_PAYMENTS_PICKUP_ADDRESS_LABEL); |
| + |
| + return l10n_util::GetStringUTF16(IDS_PAYMENTS_SHIPPING_ADDRESS_LABEL); |
| +} |
| + |
| +base::string16 GetShippingOptionSectionString( |
| + const payments::mojom::PaymentShippingType& shipping_type) { |
| + if (shipping_type == payments::mojom::PaymentShippingType::DELIVERY) |
| + return l10n_util::GetStringUTF16(IDS_PAYMENTS_DELIVERY_OPTION_LABEL); |
| + if (shipping_type == payments::mojom::PaymentShippingType::PICKUP) |
| + return l10n_util::GetStringUTF16(IDS_PAYMENTS_PICKUP_OPTION_LABEL); |
| + |
| + return l10n_util::GetStringUTF16(IDS_PAYMENTS_SHIPPING_OPTION_LABEL); |
| +} |
| + |
| } // namespace payments |