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

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

Issue 2768133002: [Web Payments] Refactor sheet display to allow updating view content (Closed)
Patch Set: Created 3 years, 9 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
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 c87e63d4bc6b982567a4837434932968f157d417..88e5d7ba6e4d9a1b10530867fb2a2002bb6df8f6 100644
--- a/chrome/browser/ui/views/payments/editor_view_controller.cc
+++ b/chrome/browser/ui/views/payments/editor_view_controller.cc
@@ -53,29 +53,6 @@ EditorViewController::EditorViewController(PaymentRequestSpec* spec,
EditorViewController::~EditorViewController() {}
-std::unique_ptr<views::View> EditorViewController::CreateView() {
- std::unique_ptr<views::View> content_view = base::MakeUnique<views::View>();
-
- views::BoxLayout* layout =
- new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0);
- layout->set_main_axis_alignment(views::BoxLayout::MAIN_AXIS_ALIGNMENT_START);
- layout->set_cross_axis_alignment(
- views::BoxLayout::CROSS_AXIS_ALIGNMENT_STRETCH);
- content_view->SetLayoutManager(layout);
- // No insets. Child views below are responsible for their padding.
-
- // An editor can optionally have a header view specific to it.
- content_view->AddChildView(CreateHeaderView().release());
-
- // The heart of the editor dialog: all the input fields with their labels.
- content_view->AddChildView(CreateEditorView().release());
-
- return CreatePaymentView(
- CreateSheetHeaderView(
- true, l10n_util::GetStringUTF16(GetViewHeaderTitleId()), this),
- std::move(content_view));
-}
-
void EditorViewController::DisplayErrorMessageForField(
const EditorField& field,
const base::string16& error_message) {
@@ -95,6 +72,22 @@ std::unique_ptr<views::Button> EditorViewController::CreatePrimaryButton() {
return button;
}
+void EditorViewController::FillContentView(views::View* content_view) {
+ views::BoxLayout* layout =
+ new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0);
+ layout->set_main_axis_alignment(views::BoxLayout::MAIN_AXIS_ALIGNMENT_START);
+ layout->set_cross_axis_alignment(
+ views::BoxLayout::CROSS_AXIS_ALIGNMENT_STRETCH);
+ content_view->SetLayoutManager(layout);
+ // No insets. Child views below are responsible for their padding.
+
+ // An editor can optionally have a header view specific to it.
+ content_view->AddChildView(CreateHeaderView().release());
+
+ // The heart of the editor dialog: all the input fields with their labels.
+ content_view->AddChildView(CreateEditorView().release());
+}
+
// Adds the "required fields" label in disabled text, to obtain this result.
// +---------------------------------------------------------+
// | "* indicates required fields" | CANCEL | DONE |

Powered by Google App Engine
This is Rietveld 408576698