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

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

Issue 2742813004: [Payments] Refactor into PaymentRequestState and Spec (Closed)
Patch Set: don't stop rebasin' 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 b9cba9ec05ef8165fa90dfdf47655e0e1d373ae8..931635c5afe2003a38a6303721ffd2ffc1796f0c 100644
--- a/chrome/browser/ui/views/payments/profile_list_view_controller.cc
+++ b/chrome/browser/ui/views/payments/profile_list_view_controller.cc
@@ -94,15 +94,16 @@ class ShippingProfileViewController : public ProfileListViewController {
std::unique_ptr<views::View> GetLabel(
autofill::AutofillProfile* profile) override {
return GetShippingAddressLabel(AddressStyleType::DETAILED,
- request_->locale(), *profile);
+ request()->GetApplicationLocale(), *profile);
}
std::vector<autofill::AutofillProfile*> GetProfiles() override {
- return request_->shipping_profiles();
+ return request()->state()->shipping_profiles();
}
base::string16 GetHeaderString() override {
- return GetShippingAddressSectionString(request_->options()->shipping_type);
+ return GetShippingAddressSectionString(
+ request()->spec()->options().shipping_type);
}
private:
@@ -120,14 +121,15 @@ class ContactProfileViewController : public ProfileListViewController {
// ProfileListViewController:
std::unique_ptr<views::View> GetLabel(
autofill::AutofillProfile* profile) override {
- return GetContactInfoLabel(AddressStyleType::DETAILED, request_->locale(),
- *profile, request_->request_payer_name(),
- request_->request_payer_phone(),
- request_->request_payer_email());
+ return GetContactInfoLabel(AddressStyleType::DETAILED,
+ request()->GetApplicationLocale(), *profile,
+ request()->spec()->request_payer_name(),
+ request()->spec()->request_payer_phone(),
+ request()->spec()->request_payer_email());
}
std::vector<autofill::AutofillProfile*> GetProfiles() override {
- return request_->contact_profiles();
+ return request()->state()->contact_profiles();
}
base::string16 GetHeaderString() override {
@@ -160,13 +162,13 @@ ProfileListViewController::GetContactProfileViewController(
ProfileListViewController::ProfileListViewController(
PaymentRequest* request,
PaymentRequestDialogView* dialog)
- : PaymentRequestSheetController(request, dialog), request_(request) {}
+ : PaymentRequestSheetController(request, dialog) {}
ProfileListViewController::~ProfileListViewController() {}
std::unique_ptr<views::View> ProfileListViewController::CreateView() {
autofill::AutofillProfile* selected_profile =
- request()->selected_shipping_profile();
+ request()->state()->selected_shipping_profile();
// This must be done at Create-time, rather than construct-time, because
// the subclass method GetProfiles can't be called in the ctor.

Powered by Google App Engine
This is Rietveld 408576698