Index: components/autofill/core/browser/autofill_manager.cc |
diff --git a/components/autofill/core/browser/autofill_manager.cc b/components/autofill/core/browser/autofill_manager.cc |
index e1c38469243bdb886bea2d6974f0e0e62ca695a6..6921626a500115c18287ed9fd16677a5b43629e3 100644 |
--- a/components/autofill/core/browser/autofill_manager.cc |
+++ b/components/autofill/core/browser/autofill_manager.cc |
@@ -1081,10 +1081,19 @@ void AutofillManager::OnDidGetUploadDetails( |
pending_upload_request_url_ = GURL(); |
} |
-void AutofillManager::OnDidUploadCard( |
- AutofillClient::PaymentsRpcResult result) { |
+void AutofillManager::OnDidUploadCard(AutofillClient::PaymentsRpcResult result, |
+ const std::string& server_id) { |
// We don't do anything user-visible if the upload attempt fails. |
- // TODO(jdonnelly): Log duration. |
+ // If the upload succeeds, we will keep a copy of the card as a full server |
+ // card on the device. |
+ if (result == AutofillClient::SUCCESS && !server_id.empty()) { |
+ upload_request_.card.set_record_type(CreditCard::FULL_SERVER_CARD); |
+ upload_request_.card.SetServerStatus(CreditCard::OK); |
+ upload_request_.card.set_server_id(server_id); |
+ DCHECK(personal_data_); |
+ if (personal_data_) |
+ personal_data_->AddFullServerCreditCard(upload_request_.card); |
+ } |
} |
void AutofillManager::OnFullCardRequestSucceeded(const CreditCard& card, |