Chromium Code Reviews| 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 933b7c5dd41a1549fca6c368a1235d2e756ba4c3..f5dee1929bb4474c4e4664a0450e6f2c1d53e4c7 100644 |
| --- a/components/autofill/core/browser/autofill_manager.cc |
| +++ b/components/autofill/core/browser/autofill_manager.cc |
| @@ -1081,10 +1081,20 @@ 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. |
| + // If the upload succeeds, we will keep a copy of the card as a full server |
| + // card on the device. |
| // TODO(jdonnelly): Log duration. |
|
Mathieu
2017/04/24 18:11:55
we should either transform this into a TODO(crbug.
csashi
2017/04/24 18:30:06
Done.
|
| + 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_->AddServerCreditCard(upload_request_.card); |
| + } |
| } |
| void AutofillManager::OnFullCardRequestSucceeded(const CreditCard& card, |