Chromium Code Reviews| 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 <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 54 std::unique_ptr<views::View> EditorViewController::CreateView() { | 54 std::unique_ptr<views::View> EditorViewController::CreateView() { |
| 55 std::unique_ptr<views::View> content_view = base::MakeUnique<views::View>(); | 55 std::unique_ptr<views::View> content_view = base::MakeUnique<views::View>(); |
| 56 | 56 |
| 57 views::BoxLayout* layout = | 57 views::BoxLayout* layout = |
| 58 new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0); | 58 new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0); |
| 59 layout->set_main_axis_alignment(views::BoxLayout::MAIN_AXIS_ALIGNMENT_START); | 59 layout->set_main_axis_alignment(views::BoxLayout::MAIN_AXIS_ALIGNMENT_START); |
| 60 layout->set_cross_axis_alignment( | 60 layout->set_cross_axis_alignment( |
| 61 views::BoxLayout::CROSS_AXIS_ALIGNMENT_STRETCH); | 61 views::BoxLayout::CROSS_AXIS_ALIGNMENT_STRETCH); |
| 62 content_view->SetLayoutManager(layout); | 62 content_view->SetLayoutManager(layout); |
| 63 | 63 |
| 64 content_view->AddChildView(CreateHeaderView()); | |
|
please use gerrit instead
2017/02/16 22:16:09
CreateHeaderView()->release(), when you start usin
Mathieu
2017/02/17 15:06:47
Done.
| |
| 65 | |
| 64 // Create an input label/textfield for each field definition. | 66 // Create an input label/textfield for each field definition. |
| 65 std::vector<EditorField> fields = GetFieldDefinitions(); | 67 std::vector<EditorField> fields = GetFieldDefinitions(); |
| 66 for (const auto& field : fields) { | 68 for (const auto& field : fields) |
| 67 content_view->AddChildView(CreateInputField(field).release()); | 69 content_view->AddChildView(CreateInputField(field).release()); |
|
please use gerrit instead
2017/02/16 22:16:09
I thought {} were always required for the "for" lo
Mathieu
2017/02/17 15:06:47
Sure
| |
| 68 } | |
| 69 | 70 |
| 70 return CreatePaymentView( | 71 return CreatePaymentView( |
| 71 CreateSheetHeaderView( | 72 CreateSheetHeaderView( |
| 72 true, l10n_util::GetStringUTF16( | 73 true, l10n_util::GetStringUTF16( |
| 73 IDS_PAYMENT_REQUEST_CREDIT_CARD_EDITOR_ADD_TITLE), | 74 IDS_PAYMENT_REQUEST_CREDIT_CARD_EDITOR_ADD_TITLE), |
| 74 this), | 75 this), |
| 75 std::move(content_view)); | 76 std::move(content_view)); |
| 76 } | 77 } |
| 77 | 78 |
| 78 std::unique_ptr<views::Button> EditorViewController::CreatePrimaryButton() { | 79 std::unique_ptr<views::Button> EditorViewController::CreatePrimaryButton() { |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 156 // |combobox| will now be owned by |row|. | 157 // |combobox| will now be owned by |row|. |
| 157 layout->AddView(combobox); | 158 layout->AddView(combobox); |
| 158 } else { | 159 } else { |
| 159 NOTREACHED(); | 160 NOTREACHED(); |
| 160 } | 161 } |
| 161 | 162 |
| 162 return row; | 163 return row; |
| 163 } | 164 } |
| 164 | 165 |
| 165 } // namespace payments | 166 } // namespace payments |
| OLD | NEW |