Chromium Code Reviews| Index: chrome/browser/ui/views/payments/payment_request_views_util.h |
| diff --git a/chrome/browser/ui/views/payments/payment_request_views_util.h b/chrome/browser/ui/views/payments/payment_request_views_util.h |
| index d72f6eadbc59ab10c074b4adeed19e3b13f1f9a9..91762417355dafc000a0fd10615b8321c86d2659 100644 |
| --- a/chrome/browser/ui/views/payments/payment_request_views_util.h |
| +++ b/chrome/browser/ui/views/payments/payment_request_views_util.h |
| @@ -6,9 +6,14 @@ |
| #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_VIEWS_UTIL_H_ |
| #include <memory> |
| +#include <string> |
| #include "base/strings/string16.h" |
| +namespace autofill { |
| +class AutofillProfile; |
| +} |
| + |
| namespace views { |
| class VectorIconButtonDelegate; |
| class View; |
| @@ -54,6 +59,28 @@ std::unique_ptr<views::View> CreatePaymentView( |
| std::unique_ptr<views::View> header_view, |
| std::unique_ptr<views::View> content_view); |
| +// Represents formatting options for each of the different contexts in which an |
| +// Address label may be displayed. |
| +enum class AddressStyleType { SUMMARY, DETAILED }; |
| + |
| +// Extracts and formats descriptive text from the given |profile| to represent |
| +// the address in the context specified by |type|. |
| +std::unique_ptr<views::View> GetShippingAddressLabel( |
| + AddressStyleType type, |
| + const std::string& locale, |
|
sky
2017/01/18 23:19:25
Do you really need to pass in different locales?
tmartino
2017/01/19 16:36:59
Yes, I believe we do. This is needed for each call
|
| + const autofill::AutofillProfile& profile); |
| + |
| +// Extracts and formats descriptive text from the given |profile| to represent |
| +// the contact info in the context specified by |type|. Includes/excludes name, |
| +// email, and phone fields according to the respective boolean fields. |
| +std::unique_ptr<views::View> GetContactInfoLabel( |
| + AddressStyleType type, |
| + const std::string& locale, |
| + const autofill::AutofillProfile& profile, |
| + bool show_payer_name, |
|
sky
2017/01/18 23:19:25
optional: Did you consider a bitmask? Generally it
tmartino
2017/01/19 16:36:59
I did consider it, yeah. If I were planning on lea
|
| + bool show_payer_email, |
| + bool show_payer_phone); |
| + |
| } // namespace payments |
| #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_VIEWS_UTIL_H_ |