| Index: chrome/browser/ui/views/payments/shipping_address_editor_view_controller.cc
|
| diff --git a/chrome/browser/ui/views/payments/shipping_address_editor_view_controller.cc b/chrome/browser/ui/views/payments/shipping_address_editor_view_controller.cc
|
| index 76f6e10373fc589dc0ac0124f32bd4dadfe25742..64a050595d05c4b515791f815c58061e6838d9f5 100644
|
| --- a/chrome/browser/ui/views/payments/shipping_address_editor_view_controller.cc
|
| +++ b/chrome/browser/ui/views/payments/shipping_address_editor_view_controller.cc
|
| @@ -74,8 +74,12 @@ ShippingAddressEditorViewController::ShippingAddressEditorViewController(
|
| PaymentRequestSpec* spec,
|
| PaymentRequestState* state,
|
| PaymentRequestDialogView* dialog,
|
| + base::OnceClosure on_edited,
|
| + base::OnceCallback<void(const autofill::AutofillProfile&)> on_added,
|
| autofill::AutofillProfile* profile)
|
| : EditorViewController(spec, state, dialog),
|
| + on_edited_(std::move(on_edited)),
|
| + on_added_(std::move(on_added)),
|
| profile_to_edit_(profile),
|
| chosen_country_index_(0),
|
| failed_to_load_region_data_(false) {
|
| @@ -120,6 +124,7 @@ bool ShippingAddressEditorViewController::ValidateModelAndSave() {
|
| // Add the profile (will not add a duplicate).
|
| profile.set_origin(autofill::kSettingsOrigin);
|
| state()->GetPersonalDataManager()->AddProfile(profile);
|
| + std::move(on_added_).Run(profile);
|
| } else {
|
| // Copy the temporary object's data to the object to be edited. Prefer this
|
| // method to copying |profile| into |profile_to_edit_|, because the latter
|
| @@ -130,6 +135,7 @@ bool ShippingAddressEditorViewController::ValidateModelAndSave() {
|
| DCHECK(success);
|
| profile_to_edit_->set_origin(autofill::kSettingsOrigin);
|
| state()->GetPersonalDataManager()->UpdateProfile(*profile_to_edit_);
|
| + std::move(on_edited_).Run();
|
| }
|
|
|
| return true;
|
|
|