| Index: components/autofill/core/browser/personal_data_manager.cc
|
| diff --git a/components/autofill/core/browser/personal_data_manager.cc b/components/autofill/core/browser/personal_data_manager.cc
|
| index e634110a718f8481083cb271cfb35b4207d8f358..9ab890cc866f229e4800ba966d9b693534a99dca 100644
|
| --- a/components/autofill/core/browser/personal_data_manager.cc
|
| +++ b/components/autofill/core/browser/personal_data_manager.cc
|
| @@ -611,6 +611,26 @@ void PersonalDataManager::UpdateCreditCard(const CreditCard& credit_card) {
|
| Refresh();
|
| }
|
|
|
| +void PersonalDataManager::AddServerCreditCard(const CreditCard& credit_card) {
|
| + DCHECK_EQ(CreditCard::FULL_SERVER_CARD, credit_card.record_type());
|
| + DCHECK(!credit_card.IsEmpty(app_locale_));
|
| + DCHECK(!credit_card.server_id().empty());
|
| +
|
| + if (is_off_the_record_ || !database_.get())
|
| + return;
|
| +
|
| + // Don't add a duplicate.
|
| + if (FindByGUID<CreditCard>(server_credit_cards_, credit_card.guid()) ||
|
| + FindByContents(server_credit_cards_, credit_card))
|
| + return;
|
| +
|
| + // Add the new credit card to the web database.
|
| + database_->AddServerCreditCard(credit_card);
|
| +
|
| + // Refresh our local cache and send notifications to observers.
|
| + Refresh();
|
| +}
|
| +
|
| void PersonalDataManager::UpdateServerCreditCard(
|
| const CreditCard& credit_card) {
|
| DCHECK_NE(CreditCard::LOCAL_CARD, credit_card.record_type());
|
|
|