| 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 |
| 11 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
| 12 #include "components/payments/mojom/payment_request.mojom.h" | 12 #include "components/payments/mojom/payment_request.mojom.h" |
| 13 #include "third_party/skia/include/core/SkColor.h" | 13 #include "third_party/skia/include/core/SkColor.h" |
| 14 #include "ui/gfx/geometry/insets.h" |
| 14 | 15 |
| 15 namespace autofill { | 16 namespace autofill { |
| 16 class AutofillProfile; | 17 class AutofillProfile; |
| 17 } | 18 } |
| 18 | 19 |
| 19 namespace views { | 20 namespace views { |
| 20 class Border; | 21 class Border; |
| 21 class ButtonListener; | 22 class ButtonListener; |
| 22 class ImageView; | 23 class ImageView; |
| 23 class Label; | 24 class Label; |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 // Extracts and formats descriptive text from the given |profile| to represent | 107 // Extracts and formats descriptive text from the given |profile| to represent |
| 107 // the contact info in the context specified by |type|. Includes/excludes name, | 108 // the contact info in the context specified by |type|. Includes/excludes name, |
| 108 // email, and phone fields according to the respective boolean fields. | 109 // email, and phone fields according to the respective boolean fields. |
| 109 std::unique_ptr<views::View> GetContactInfoLabel( | 110 std::unique_ptr<views::View> GetContactInfoLabel( |
| 110 AddressStyleType type, | 111 AddressStyleType type, |
| 111 const std::string& locale, | 112 const std::string& locale, |
| 112 const autofill::AutofillProfile& profile, | 113 const autofill::AutofillProfile& profile, |
| 113 const PaymentOptionsProvider& options, | 114 const PaymentOptionsProvider& options, |
| 114 const PaymentsProfileComparator& comp); | 115 const PaymentsProfileComparator& comp); |
| 115 | 116 |
| 116 // Creates a views::Border object that can paint the gray horizontal ruler used | 117 // Creates a views::Border object with |insets| that can paint the gray |
| 117 // as a separator between items in the Payment Request dialog. | 118 // horizontal ruler used as a separator between items in the Payment Request |
| 118 std::unique_ptr<views::Border> CreatePaymentRequestRowBorder(SkColor color); | 119 // dialog. |
| 120 std::unique_ptr<views::Border> CreatePaymentRequestRowBorder( |
| 121 SkColor color, |
| 122 const gfx::Insets& insets); |
| 119 | 123 |
| 120 // Creates a label with a bold font. | 124 // Creates a label with a bold font. |
| 121 std::unique_ptr<views::Label> CreateBoldLabel(const base::string16& text); | 125 std::unique_ptr<views::Label> CreateBoldLabel(const base::string16& text); |
| 122 | 126 |
| 123 // Creates a 2 line label containing |shipping_option|'s label and amount. If | 127 // Creates a 2 line label containing |shipping_option|'s label and amount. If |
| 124 // |emphasize_label| is true, the label part will be in medium weight. | 128 // |emphasize_label| is true, the label part will be in medium weight. |
| 125 std::unique_ptr<views::View> CreateShippingOptionLabel( | 129 std::unique_ptr<views::View> CreateShippingOptionLabel( |
| 126 payments::mojom::PaymentShippingOption* shipping_option, | 130 payments::mojom::PaymentShippingOption* shipping_option, |
| 127 const base::string16& formatted_amount, | 131 const base::string16& formatted_amount, |
| 128 bool emphasize_label); | 132 bool emphasize_label); |
| 129 | 133 |
| 130 } // namespace payments | 134 } // namespace payments |
| 131 | 135 |
| 132 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_VIEWS_UTIL_H_ | 136 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_VIEWS_UTIL_H_ |
| OLD | NEW |