| 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_sheet_view_controller.h" | 5 #include "chrome/browser/ui/views/payments/payment_sheet_view_controller.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 columns->AddColumn(views::GridLayout::TRAILING, views::GridLayout::CENTER, | 161 columns->AddColumn(views::GridLayout::TRAILING, views::GridLayout::CENTER, |
| 162 0, views::GridLayout::USE_PREF, 0, 0); | 162 0, views::GridLayout::USE_PREF, 0, 0); |
| 163 | 163 |
| 164 constexpr int kPaddingColumnsWidth = 25; | 164 constexpr int kPaddingColumnsWidth = 25; |
| 165 columns->AddPaddingColumn(0, kPaddingColumnsWidth); | 165 columns->AddPaddingColumn(0, kPaddingColumnsWidth); |
| 166 // A column for the trailing_button. | 166 // A column for the trailing_button. |
| 167 columns->AddColumn(views::GridLayout::TRAILING, views::GridLayout::CENTER, | 167 columns->AddColumn(views::GridLayout::TRAILING, views::GridLayout::CENTER, |
| 168 0, views::GridLayout::USE_PREF, 0, 0); | 168 0, views::GridLayout::USE_PREF, 0, 0); |
| 169 | 169 |
| 170 layout->StartRow(0, 0); | 170 layout->StartRow(0, 0); |
| 171 views::Label* name_label = new views::Label(section_name); | 171 std::unique_ptr<views::Label> name_label = CreateMediumLabel(section_name); |
| 172 name_label->SetMultiLine(true); | 172 name_label->SetMultiLine(true); |
| 173 name_label->SetFontList( | 173 layout->AddView(name_label.release()); |
| 174 name_label->font_list().DeriveWithWeight(gfx::Font::Weight::MEDIUM)); | |
| 175 layout->AddView(name_label); | |
| 176 | 174 |
| 177 if (content_view) { | 175 if (content_view) { |
| 178 content_view->set_can_process_events_within_subtree(false); | 176 content_view->set_can_process_events_within_subtree(false); |
| 179 layout->AddView(content_view.release()); | 177 layout->AddView(content_view.release()); |
| 180 } else { | 178 } else { |
| 181 layout->SkipColumns(1); | 179 layout->SkipColumns(1); |
| 182 } | 180 } |
| 183 | 181 |
| 184 if (extra_content_view) { | 182 if (extra_content_view) { |
| 185 extra_content_view->set_can_process_events_within_subtree(false); | 183 extra_content_view->set_can_process_events_within_subtree(false); |
| (...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 944 data_source_label->SetDefaultStyle(default_style); | 942 data_source_label->SetDefaultStyle(default_style); |
| 945 data_source_label->AddStyleRange( | 943 data_source_label->AddStyleRange( |
| 946 gfx::Range(link_begin, link_begin + link_length), | 944 gfx::Range(link_begin, link_begin + link_length), |
| 947 views::StyledLabel::RangeStyleInfo::CreateForLink()); | 945 views::StyledLabel::RangeStyleInfo::CreateForLink()); |
| 948 data_source_label->SizeToFit(0); | 946 data_source_label->SizeToFit(0); |
| 949 content_view->AddChildView(data_source_label.release()); | 947 content_view->AddChildView(data_source_label.release()); |
| 950 return content_view; | 948 return content_view; |
| 951 } | 949 } |
| 952 | 950 |
| 953 } // namespace payments | 951 } // namespace payments |
| OLD | NEW |