| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/editor_view_controller.h" | 5 #include "chrome/browser/ui/views/payments/editor_view_controller.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 } | 179 } |
| 180 | 180 |
| 181 std::unique_ptr<views::View> EditorViewController::CreateEditorView() { | 181 std::unique_ptr<views::View> EditorViewController::CreateEditorView() { |
| 182 std::unique_ptr<views::View> editor_view = base::MakeUnique<views::View>(); | 182 std::unique_ptr<views::View> editor_view = base::MakeUnique<views::View>(); |
| 183 text_fields_.clear(); | 183 text_fields_.clear(); |
| 184 comboboxes_.clear(); | 184 comboboxes_.clear(); |
| 185 | 185 |
| 186 std::unique_ptr<views::GridLayout> editor_layout = | 186 std::unique_ptr<views::GridLayout> editor_layout = |
| 187 base::MakeUnique<views::GridLayout>(editor_view.get()); | 187 base::MakeUnique<views::GridLayout>(editor_view.get()); |
| 188 | 188 |
| 189 // The editor grid layout is padded horizontally. | 189 // The editor view is padded horizontally. |
| 190 editor_layout->SetInsets(0, payments::kPaymentRequestRowHorizontalInsets, 0, | 190 editor_view->SetBorder(views::CreateEmptyBorder( |
| 191 payments::kPaymentRequestRowHorizontalInsets); | 191 0, payments::kPaymentRequestRowHorizontalInsets, 0, |
| 192 payments::kPaymentRequestRowHorizontalInsets)); |
| 192 | 193 |
| 193 views::ColumnSet* columns = editor_layout->AddColumnSet(0); | 194 views::ColumnSet* columns = editor_layout->AddColumnSet(0); |
| 194 columns->AddColumn(views::GridLayout::LEADING, views::GridLayout::CENTER, 0, | 195 columns->AddColumn(views::GridLayout::LEADING, views::GridLayout::CENTER, 0, |
| 195 views::GridLayout::USE_PREF, 0, 0); | 196 views::GridLayout::USE_PREF, 0, 0); |
| 196 | 197 |
| 197 // This is the horizontal padding between the label and the input field. | 198 // This is the horizontal padding between the label and the input field. |
| 198 constexpr int kLabelInputFieldHorizontalPadding = 16; | 199 constexpr int kLabelInputFieldHorizontalPadding = 16; |
| 199 columns->AddPaddingColumn(0, kLabelInputFieldHorizontalPadding); | 200 columns->AddPaddingColumn(0, kLabelInputFieldHorizontalPadding); |
| 200 | 201 |
| 201 columns->AddColumn(views::GridLayout::LEADING, views::GridLayout::CENTER, 0, | 202 columns->AddColumn(views::GridLayout::LEADING, views::GridLayout::CENTER, 0, |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 base::MakeUnique<views::View>(); | 277 base::MakeUnique<views::View>(); |
| 277 error_label_view->SetLayoutManager(new views::FillLayout); | 278 error_label_view->SetLayoutManager(new views::FillLayout); |
| 278 error_labels_[field] = error_label_view.get(); | 279 error_labels_[field] = error_label_view.get(); |
| 279 layout->AddView(error_label_view.release()); | 280 layout->AddView(error_label_view.release()); |
| 280 | 281 |
| 281 // Bottom padding for the row. | 282 // Bottom padding for the row. |
| 282 layout->AddPaddingRow(0, kInputRowSpacing); | 283 layout->AddPaddingRow(0, kInputRowSpacing); |
| 283 } | 284 } |
| 284 | 285 |
| 285 } // namespace payments | 286 } // namespace payments |
| OLD | NEW |