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

Unified Diff: chrome/browser/ui/views/payments/profile_list_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/profile_list_view_controller.cc
diff --git a/chrome/browser/ui/views/payments/profile_list_view_controller.cc b/chrome/browser/ui/views/payments/profile_list_view_controller.cc
index 025571e4873dc24bc9858761cfeeb363896468f0..ea6de3fdb9f287aed06876924a96ff6e143ddb30 100644
--- a/chrome/browser/ui/views/payments/profile_list_view_controller.cc
+++ b/chrome/browser/ui/views/payments/profile_list_view_controller.cc
@@ -78,7 +78,9 @@ class ShippingProfileViewController : public ProfileListViewController {
ShippingProfileViewController(PaymentRequestSpec* spec,
PaymentRequestState* state,
PaymentRequestDialogView* dialog)
- : ProfileListViewController(spec, state, dialog) {}
+ : ProfileListViewController(spec, state, dialog) {
+ PopulateList();
+ }
~ShippingProfileViewController() override {}
protected:
@@ -101,7 +103,7 @@ class ShippingProfileViewController : public ProfileListViewController {
return state()->shipping_profiles();
}
- base::string16 GetHeaderString() override {
+ base::string16 GetSheetTitle() override {
return GetShippingAddressSectionString(spec()->options().shipping_type);
}
@@ -114,7 +116,9 @@ class ContactProfileViewController : public ProfileListViewController {
ContactProfileViewController(PaymentRequestSpec* spec,
PaymentRequestState* state,
PaymentRequestDialogView* dialog)
- : ProfileListViewController(spec, state, dialog) {}
+ : ProfileListViewController(spec, state, dialog) {
+ PopulateList();
+ }
~ContactProfileViewController() override {}
protected:
@@ -139,7 +143,7 @@ class ContactProfileViewController : public ProfileListViewController {
return state()->contact_profiles();
}
- base::string16 GetHeaderString() override {
+ base::string16 GetSheetTitle() override {
return l10n_util::GetStringUTF16(
IDS_PAYMENT_REQUEST_CONTACT_INFO_SECTION_NAME);
}
@@ -176,7 +180,7 @@ ProfileListViewController::ProfileListViewController(
ProfileListViewController::~ProfileListViewController() {}
-std::unique_ptr<views::View> ProfileListViewController::CreateView() {
+void ProfileListViewController::PopulateList() {
autofill::AutofillProfile* selected_profile = GetSelectedProfile();
// This must be done at Create-time, rather than construct-time, because
@@ -186,11 +190,10 @@ std::unique_ptr<views::View> ProfileListViewController::CreateView() {
&list_, this, dialog(),
profile == selected_profile));
}
+}
- return CreatePaymentView(
- CreateSheetHeaderView(
- /* show_back_arrow = */ true, GetHeaderString(), this),
- list_.CreateListView());
+void ProfileListViewController::FillContentView(views::View* content_view) {
+ content_view->AddChildView(list_.CreateListView().release());
}
} // namespace payments

Powered by Google App Engine
This is Rietveld 408576698