| 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 <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 const base::string16& section_name, | 99 const base::string16& section_name, |
| 100 std::unique_ptr<views::View> content_view, | 100 std::unique_ptr<views::View> content_view, |
| 101 std::unique_ptr<views::View> extra_content_view, | 101 std::unique_ptr<views::View> extra_content_view, |
| 102 int name_column_width) { | 102 int name_column_width) { |
| 103 std::unique_ptr<PaymentRequestRowView> row = | 103 std::unique_ptr<PaymentRequestRowView> row = |
| 104 base::MakeUnique<PaymentRequestRowView>(listener); | 104 base::MakeUnique<PaymentRequestRowView>(listener); |
| 105 views::GridLayout* layout = new views::GridLayout(row.get()); | 105 views::GridLayout* layout = new views::GridLayout(row.get()); |
| 106 | 106 |
| 107 // The rows have extra inset compared to the header so that their right edge | 107 // The rows have extra inset compared to the header so that their right edge |
| 108 // lines up with the close button's X rather than its invisible right edge. | 108 // lines up with the close button's X rather than its invisible right edge. |
| 109 constexpr int kRowExtraRightInset = 8; | 109 layout->SetInsets( |
| 110 layout->SetInsets(kPaymentRequestRowVerticalInsets, | 110 kPaymentRequestRowVerticalInsets, kPaymentRequestRowHorizontalInsets, |
| 111 kPaymentRequestRowHorizontalInsets, | 111 kPaymentRequestRowVerticalInsets, |
| 112 kPaymentRequestRowVerticalInsets, | 112 kPaymentRequestRowHorizontalInsets + kPaymentRequestRowExtraRightInset); |
| 113 kPaymentRequestRowHorizontalInsets + kRowExtraRightInset); | |
| 114 row->SetLayoutManager(layout); | 113 row->SetLayoutManager(layout); |
| 115 | 114 |
| 116 views::ColumnSet* columns = layout->AddColumnSet(0); | 115 views::ColumnSet* columns = layout->AddColumnSet(0); |
| 117 // A column for the section name. | 116 // A column for the section name. |
| 118 columns->AddColumn(views::GridLayout::LEADING, | 117 columns->AddColumn(views::GridLayout::LEADING, |
| 119 views::GridLayout::LEADING, | 118 views::GridLayout::LEADING, |
| 120 0, | 119 0, |
| 121 views::GridLayout::FIXED, | 120 views::GridLayout::FIXED, |
| 122 name_column_width, | 121 name_column_width, |
| 123 0); | 122 0); |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 CreateContactInfoSectionContent(), std::unique_ptr<views::View>(nullptr), | 378 CreateContactInfoSectionContent(), std::unique_ptr<views::View>(nullptr), |
| 380 widest_name_column_view_width_); | 379 widest_name_column_view_width_); |
| 381 section->set_tag(static_cast<int>( | 380 section->set_tag(static_cast<int>( |
| 382 PaymentSheetViewControllerTags::SHOW_CONTACT_INFO_BUTTON)); | 381 PaymentSheetViewControllerTags::SHOW_CONTACT_INFO_BUTTON)); |
| 383 section->set_id( | 382 section->set_id( |
| 384 static_cast<int>(DialogViewID::PAYMENT_SHEET_CONTACT_INFO_SECTION)); | 383 static_cast<int>(DialogViewID::PAYMENT_SHEET_CONTACT_INFO_SECTION)); |
| 385 return section; | 384 return section; |
| 386 } | 385 } |
| 387 | 386 |
| 388 } // namespace payments | 387 } // namespace payments |
| OLD | NEW |