Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(724)

Side by Side Diff: chrome/browser/ui/views/payments/editor_view_controller.cc

Issue 2698353002: [Payments] Add the "Cards accepted" row at the top of CC editor. (Closed)
Patch Set: private Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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().release());
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());
68 } 70 }
69 71
70 return CreatePaymentView( 72 return CreatePaymentView(
71 CreateSheetHeaderView( 73 CreateSheetHeaderView(
72 true, l10n_util::GetStringUTF16( 74 true, l10n_util::GetStringUTF16(
73 IDS_PAYMENT_REQUEST_CREDIT_CARD_EDITOR_ADD_TITLE), 75 IDS_PAYMENT_REQUEST_CREDIT_CARD_EDITOR_ADD_TITLE),
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 // |combobox| will now be owned by |row|. 158 // |combobox| will now be owned by |row|.
157 layout->AddView(combobox); 159 layout->AddView(combobox);
158 } else { 160 } else {
159 NOTREACHED(); 161 NOTREACHED();
160 } 162 }
161 163
162 return row; 164 return row;
163 } 165 }
164 166
165 } // namespace payments 167 } // namespace payments
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698