OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/autofill/core/browser/personal_data_manager.h" | 5 #include "components/autofill/core/browser/personal_data_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 #include <iterator> | 9 #include <iterator> |
10 | 10 |
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
664 if (existing_credit_card->record_type() == CreditCard::MASKED_SERVER_CARD) { | 664 if (existing_credit_card->record_type() == CreditCard::MASKED_SERVER_CARD) { |
665 database_->UnmaskServerCreditCard(credit_card.server_id(), | 665 database_->UnmaskServerCreditCard(credit_card.server_id(), |
666 credit_card.number()); | 666 credit_card.number()); |
667 } else { | 667 } else { |
668 database_->MaskServerCreditCard(credit_card.server_id()); | 668 database_->MaskServerCreditCard(credit_card.server_id()); |
669 } | 669 } |
670 | 670 |
671 Refresh(); | 671 Refresh(); |
672 } | 672 } |
673 | 673 |
| 674 void PersonalDataManager::ResetFullServerCard(const std::string& guid) { |
| 675 for (const CreditCard* card : server_credit_cards_) { |
| 676 if (card->guid() == guid) { |
| 677 DCHECK_EQ(card->record_type(), CreditCard::FULL_SERVER_CARD); |
| 678 CreditCard card_copy = *card; |
| 679 card_copy.set_record_type(CreditCard::MASKED_SERVER_CARD); |
| 680 card_copy.SetNumber(card->LastFourDigits()); |
| 681 UpdateServerCreditCard(card_copy); |
| 682 break; |
| 683 } |
| 684 } |
| 685 } |
| 686 |
674 void PersonalDataManager::ResetFullServerCards() { | 687 void PersonalDataManager::ResetFullServerCards() { |
675 for (const CreditCard* card : server_credit_cards_) { | 688 for (const CreditCard* card : server_credit_cards_) { |
676 CreditCard card_copy = *card; | 689 CreditCard card_copy = *card; |
677 if (card_copy.record_type() == CreditCard::FULL_SERVER_CARD) { | 690 if (card_copy.record_type() == CreditCard::FULL_SERVER_CARD) { |
678 card_copy.set_record_type(CreditCard::MASKED_SERVER_CARD); | 691 card_copy.set_record_type(CreditCard::MASKED_SERVER_CARD); |
679 card_copy.SetNumber(card->LastFourDigits()); | 692 card_copy.SetNumber(card->LastFourDigits()); |
680 UpdateServerCreditCard(card_copy); | 693 UpdateServerCreditCard(card_copy); |
681 } | 694 } |
682 } | 695 } |
683 } | 696 } |
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1343 } | 1356 } |
1344 if (IsExperimentalWalletIntegrationEnabled() && | 1357 if (IsExperimentalWalletIntegrationEnabled() && |
1345 pref_service_->GetBoolean(prefs::kAutofillWalletImportEnabled)) { | 1358 pref_service_->GetBoolean(prefs::kAutofillWalletImportEnabled)) { |
1346 profiles_.insert( | 1359 profiles_.insert( |
1347 profiles_.end(), server_profiles_.begin(), server_profiles_.end()); | 1360 profiles_.end(), server_profiles_.begin(), server_profiles_.end()); |
1348 } | 1361 } |
1349 return profiles_; | 1362 return profiles_; |
1350 } | 1363 } |
1351 | 1364 |
1352 } // namespace autofill | 1365 } // namespace autofill |
OLD | NEW |