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 #include "chrome/browser/ui/views/payments/payment_request_views_util.h" | 5 #include "chrome/browser/ui/views/payments/payment_request_views_util.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
73 views::BoxLayout::CROSS_AXIS_ALIGNMENT_START); | 73 views::BoxLayout::CROSS_AXIS_ALIGNMENT_START); |
74 container->SetLayoutManager(layout.release()); | 74 container->SetLayoutManager(layout.release()); |
75 | 75 |
76 if (!s1.empty()) { | 76 if (!s1.empty()) { |
77 std::unique_ptr<views::Label> label = base::MakeUnique<views::Label>(s1); | 77 std::unique_ptr<views::Label> label = base::MakeUnique<views::Label>(s1); |
78 if (type == AddressStyleType::DETAILED) { | 78 if (type == AddressStyleType::DETAILED) { |
79 const gfx::FontList& font_list = label->font_list(); | 79 const gfx::FontList& font_list = label->font_list(); |
80 label->SetFontList(font_list.DeriveWithWeight(gfx::Font::Weight::BOLD)); | 80 label->SetFontList(font_list.DeriveWithWeight(gfx::Font::Weight::BOLD)); |
81 } | 81 } |
82 label->set_id(static_cast<int>(DialogViewID::THREE_LINE_LABEL_LINE_1)); | 82 label->set_id(static_cast<int>(DialogViewID::THREE_LINE_LABEL_LINE_1)); |
83 label->SetHorizontalAlignment(gfx::ALIGN_LEFT); | |
Mathieu
2017/04/27 18:17:00
bleh, how is this not the default :\
| |
83 container->AddChildView(label.release()); | 84 container->AddChildView(label.release()); |
84 } | 85 } |
85 | 86 |
86 if (!s2.empty()) { | 87 if (!s2.empty()) { |
87 std::unique_ptr<views::Label> label = base::MakeUnique<views::Label>(s2); | 88 std::unique_ptr<views::Label> label = base::MakeUnique<views::Label>(s2); |
88 label->set_id(static_cast<int>(DialogViewID::THREE_LINE_LABEL_LINE_2)); | 89 label->set_id(static_cast<int>(DialogViewID::THREE_LINE_LABEL_LINE_2)); |
90 label->SetHorizontalAlignment(gfx::ALIGN_LEFT); | |
89 container->AddChildView(label.release()); | 91 container->AddChildView(label.release()); |
90 } | 92 } |
91 | 93 |
92 if (!s3.empty()) { | 94 if (!s3.empty()) { |
93 std::unique_ptr<views::Label> label = base::MakeUnique<views::Label>(s3); | 95 std::unique_ptr<views::Label> label = base::MakeUnique<views::Label>(s3); |
94 label->set_id(static_cast<int>(DialogViewID::THREE_LINE_LABEL_LINE_3)); | 96 label->set_id(static_cast<int>(DialogViewID::THREE_LINE_LABEL_LINE_3)); |
97 label->SetHorizontalAlignment(gfx::ALIGN_LEFT); | |
95 container->AddChildView(label.release()); | 98 container->AddChildView(label.release()); |
96 } | 99 } |
97 | 100 |
98 // TODO(anthonyvd): add the error label | 101 // TODO(anthonyvd): add the error label |
99 | 102 |
100 return container; | 103 return container; |
101 } | 104 } |
102 | 105 |
103 // Paints the gray horizontal line that doesn't span the entire width of the | 106 // Paints the gray horizontal line that doesn't span the entire width of the |
104 // dialog at the bottom of the view it borders. | 107 // dialog at the bottom of the view it borders. |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
297 base::MakeUnique<views::Label>(formatted_amount); | 300 base::MakeUnique<views::Label>(formatted_amount); |
298 amount_label->set_id( | 301 amount_label->set_id( |
299 static_cast<int>(DialogViewID::SHIPPING_OPTION_AMOUNT)); | 302 static_cast<int>(DialogViewID::SHIPPING_OPTION_AMOUNT)); |
300 container->AddChildView(amount_label.release()); | 303 container->AddChildView(amount_label.release()); |
301 } | 304 } |
302 | 305 |
303 return container; | 306 return container; |
304 } | 307 } |
305 | 308 |
306 } // namespace payments | 309 } // namespace payments |
OLD | NEW |