| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_VIEWS_UTIL_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_VIEWS_UTIL_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_VIEWS_UTIL_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_VIEWS_UTIL_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 const base::string16& tooltip_text, | 79 const base::string16& tooltip_text, |
| 80 float opacity = 1.0f); | 80 float opacity = 1.0f); |
| 81 | 81 |
| 82 std::unique_ptr<views::View> CreateProductLogoFooterView(); | 82 std::unique_ptr<views::View> CreateProductLogoFooterView(); |
| 83 | 83 |
| 84 // Represents formatting options for each of the different contexts in which an | 84 // Represents formatting options for each of the different contexts in which an |
| 85 // Address label may be displayed. | 85 // Address label may be displayed. |
| 86 enum class AddressStyleType { SUMMARY, DETAILED }; | 86 enum class AddressStyleType { SUMMARY, DETAILED }; |
| 87 | 87 |
| 88 // Extracts and formats descriptive text from the given |profile| to represent | 88 // Extracts and formats descriptive text from the given |profile| to represent |
| 89 // the address in the context specified by |type|. If |error| is specified, | |
| 90 // this will display it as the last item in an error state. |disabled_state| | |
| 91 // will make the various label lines look disabled. | |
| 92 std::unique_ptr<views::View> GetShippingAddressLabelWithError( | |
| 93 AddressStyleType type, | |
| 94 const std::string& locale, | |
| 95 const autofill::AutofillProfile& profile, | |
| 96 const base::string16& error, | |
| 97 bool disabled_state); | |
| 98 | |
| 99 // Extracts and formats descriptive text from the given |profile| to represent | |
| 100 // the address in the context specified by |type|. The missing information will | 89 // the address in the context specified by |type|. The missing information will |
| 101 // be computed using |comp| and displayed as the last line in an informative | 90 // be computed using |comp| and displayed as the last line in an informative |
| 102 // manner. | 91 // manner. |enabled| indicates whether the various label lines look enabled or |
| 92 // disabled. |
| 103 std::unique_ptr<views::View> GetShippingAddressLabelWithMissingInfo( | 93 std::unique_ptr<views::View> GetShippingAddressLabelWithMissingInfo( |
| 104 AddressStyleType type, | 94 AddressStyleType type, |
| 105 const std::string& locale, | 95 const std::string& locale, |
| 106 const autofill::AutofillProfile& profile, | 96 const autofill::AutofillProfile& profile, |
| 107 const PaymentsProfileComparator& comp); | 97 const PaymentsProfileComparator& comp, |
| 98 bool enabled = true); |
| 108 | 99 |
| 109 // Extracts and formats descriptive text from the given |profile| to represent | 100 // Extracts and formats descriptive text from the given |profile| to represent |
| 110 // the contact info in the context specified by |type|. Includes/excludes name, | 101 // the contact info in the context specified by |type|. Includes/excludes name, |
| 111 // email, and phone fields according to the respective boolean fields. | 102 // email, and phone fields according to the respective boolean fields. |
| 112 std::unique_ptr<views::View> GetContactInfoLabel( | 103 std::unique_ptr<views::View> GetContactInfoLabel( |
| 113 AddressStyleType type, | 104 AddressStyleType type, |
| 114 const std::string& locale, | 105 const std::string& locale, |
| 115 const autofill::AutofillProfile& profile, | 106 const autofill::AutofillProfile& profile, |
| 116 const PaymentOptionsProvider& options, | 107 const PaymentOptionsProvider& options, |
| 117 const PaymentsProfileComparator& comp); | 108 const PaymentsProfileComparator& comp); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 134 // Creates a 2 line label containing |shipping_option|'s label and amount. If | 125 // Creates a 2 line label containing |shipping_option|'s label and amount. If |
| 135 // |emphasize_label| is true, the label part will be in medium weight. | 126 // |emphasize_label| is true, the label part will be in medium weight. |
| 136 std::unique_ptr<views::View> CreateShippingOptionLabel( | 127 std::unique_ptr<views::View> CreateShippingOptionLabel( |
| 137 payments::mojom::PaymentShippingOption* shipping_option, | 128 payments::mojom::PaymentShippingOption* shipping_option, |
| 138 const base::string16& formatted_amount, | 129 const base::string16& formatted_amount, |
| 139 bool emphasize_label); | 130 bool emphasize_label); |
| 140 | 131 |
| 141 } // namespace payments | 132 } // namespace payments |
| 142 | 133 |
| 143 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_VIEWS_UTIL_H_ | 134 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_VIEWS_UTIL_H_ |
| OLD | NEW |