| 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 7a546aef74507b7ec24f759d133459cf7b31038a..f71b655f4ade104a22e2f28a3f727702e5d095fe 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
|
| @@ -119,10 +119,16 @@ bool ShippingAddressEditorViewController::ValidateModelAndSave() {
|
| std::move(on_added_).Run(profile);
|
| on_edited_.Reset();
|
| } 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
|
| - // object needs to retain other properties (use count, use date, guid,
|
| + autofill::ServerFieldTypeSet all_fields;
|
| + profile_to_edit_->GetSupportedTypes(&all_fields);
|
| + // Clear all the address data in |profile_to_edit_|, in anticipation of
|
| + // adding only the fields present in the editor. Prefer this method to
|
| + // copying |profile| into |profile_to_edit_|, because the latter object
|
| + // needs to retain other properties (use count, use date, guid,
|
| // etc.).
|
| + for (autofill::ServerFieldType type : all_fields)
|
| + profile_to_edit_->SetRawInfo(type, base::string16());
|
| +
|
| bool success = SaveFieldsToProfile(profile_to_edit_,
|
| /*ignore_errors=*/false);
|
| DCHECK(success);
|
|
|