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 #include "ui/gfx/geometry/insets.h" |
| 15 #include "ui/gfx/text_constants.h" |
15 | 16 |
16 namespace autofill { | 17 namespace autofill { |
17 class AutofillProfile; | 18 class AutofillProfile; |
18 } | 19 } |
19 | 20 |
20 namespace views { | 21 namespace views { |
21 class Border; | 22 class Border; |
22 class ButtonListener; | 23 class ButtonListener; |
23 class ImageView; | 24 class ImageView; |
24 class Label; | 25 class Label; |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 const gfx::Insets& insets); | 125 const gfx::Insets& insets); |
125 | 126 |
126 // Creates a label with a bold font. | 127 // Creates a label with a bold font. |
127 std::unique_ptr<views::Label> CreateBoldLabel(const base::string16& text); | 128 std::unique_ptr<views::Label> CreateBoldLabel(const base::string16& text); |
128 | 129 |
129 // Creates a label with a medium-weight font, with appropriate fallbacks for | 130 // Creates a label with a medium-weight font, with appropriate fallbacks for |
130 // platforms that have no medium font, or where a user has configured their | 131 // platforms that have no medium font, or where a user has configured their |
131 // default font with a heavier weight. | 132 // default font with a heavier weight. |
132 std::unique_ptr<views::Label> CreateMediumLabel(const base::string16& text); | 133 std::unique_ptr<views::Label> CreateMediumLabel(const base::string16& text); |
133 | 134 |
| 135 // Creates a label with grey, "hint" text and the provided |alignment|. |
| 136 std::unique_ptr<views::Label> CreateHintLabel( |
| 137 const base::string16& text, |
| 138 gfx::HorizontalAlignment alignment = gfx::ALIGN_CENTER); |
| 139 |
134 // Creates a 2 line label containing |shipping_option|'s label and amount. If | 140 // 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. | 141 // |emphasize_label| is true, the label part will be in medium weight. |
136 std::unique_ptr<views::View> CreateShippingOptionLabel( | 142 std::unique_ptr<views::View> CreateShippingOptionLabel( |
137 payments::mojom::PaymentShippingOption* shipping_option, | 143 payments::mojom::PaymentShippingOption* shipping_option, |
138 const base::string16& formatted_amount, | 144 const base::string16& formatted_amount, |
139 bool emphasize_label); | 145 bool emphasize_label); |
140 | 146 |
141 } // namespace payments | 147 } // namespace payments |
142 | 148 |
143 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_VIEWS_UTIL_H_ | 149 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_VIEWS_UTIL_H_ |
OLD | NEW |