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

Unified Diff: chrome/browser/ui/views/payments/editor_view_controller.cc

Issue 2882463002: [Web Payments] UI tweaks to desktop editors (Closed)
Patch Set: Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/payments/editor_view_controller.h ('k') | components/payments_strings.grdp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/payments/editor_view_controller.cc
diff --git a/chrome/browser/ui/views/payments/editor_view_controller.cc b/chrome/browser/ui/views/payments/editor_view_controller.cc
index a6e926ebae2399c4a477f373a0abcaa98d0b1d44..a4375c45b4ce09c4fb6bb3c2f124b347b10b8c97 100644
--- a/chrome/browser/ui/views/payments/editor_view_controller.cc
+++ b/chrome/browser/ui/views/payments/editor_view_controller.cc
@@ -133,28 +133,8 @@ void EditorViewController::FillContentView(views::View* content_view) {
content_view->AddChildView(CreateEditorView().release());
}
-// Adds the "required fields" label in disabled text, to obtain this result.
-// +---------------------------------------------------------+
-// | "* indicates required fields" | CANCEL | DONE |
-// +---------------------------------------------------------+
-std::unique_ptr<views::View> EditorViewController::CreateExtraFooterView() {
- std::unique_ptr<views::View> content_view = base::MakeUnique<views::View>();
-
- views::BoxLayout* layout =
- new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0);
- layout->set_main_axis_alignment(views::BoxLayout::MAIN_AXIS_ALIGNMENT_START);
- layout->set_cross_axis_alignment(
- views::BoxLayout::CROSS_AXIS_ALIGNMENT_START);
- content_view->SetLayoutManager(layout);
-
- // Adds the "* indicates a required field" label in "disabled" grey text.
- std::unique_ptr<views::Label> label = base::MakeUnique<views::Label>(
- l10n_util::GetStringUTF16(IDS_PAYMENTS_REQUIRED_FIELD_MESSAGE));
- label->SetDisabledColor(label->GetNativeTheme()->GetSystemColor(
- ui::NativeTheme::kColorId_LabelDisabledColor));
- label->SetEnabled(false);
- content_view->AddChildView(label.release());
- return content_view;
+base::string16 EditorViewController::GetSecondaryButtonLabel() {
+ return l10n_util::GetStringUTF16(IDS_PAYMENTS_CANCEL_PAYMENT);
}
void EditorViewController::UpdateEditorView() {
@@ -224,14 +204,28 @@ std::unique_ptr<views::View> EditorViewController::CreateEditorView() {
columns->AddColumn(views::GridLayout::LEADING, views::GridLayout::CENTER, 0,
views::GridLayout::USE_PREF, 0, 0);
- editor_view->SetLayoutManager(editor_layout.release());
std::vector<EditorField> fields = GetFieldDefinitions();
for (const auto& field : fields) {
Mathieu 2017/05/11 18:15:14 no curlz
anthonyvd 2017/05/11 21:21:50 Done.
- CreateInputField(
- static_cast<views::GridLayout*>(editor_view->GetLayoutManager()),
- field);
+ CreateInputField(editor_layout.get(), field);
}
+ // Adds the "* indicates a required field" label in "disabled" grey text.
+ std::unique_ptr<views::Label> required_field = base::MakeUnique<views::Label>(
+ l10n_util::GetStringUTF16(IDS_PAYMENTS_REQUIRED_FIELD_MESSAGE));
+ required_field->SetDisabledColor(
+ required_field->GetNativeTheme()->GetSystemColor(
+ ui::NativeTheme::kColorId_LabelDisabledColor));
+ required_field->SetEnabled(false);
+
+ views::ColumnSet* required_field_columns = editor_layout->AddColumnSet(1);
Mathieu 2017/05/11 18:15:14 I think you'll need a big rebase
anthonyvd 2017/05/11 21:21:50 Done.
+ required_field_columns->AddColumn(views::GridLayout::LEADING,
+ views::GridLayout::CENTER, 1,
+ views::GridLayout::USE_PREF, 0, 0);
+ editor_layout->StartRow(0, 1);
+ editor_layout->AddView(required_field.release());
+
+ editor_view->SetLayoutManager(editor_layout.release());
+
return editor_view;
}
« no previous file with comments | « chrome/browser/ui/views/payments/editor_view_controller.h ('k') | components/payments_strings.grdp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698