| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <list> | 10 #include <list> |
| (...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 638 if (existing_credit_card->record_type() == CreditCard::MASKED_SERVER_CARD) { | 638 if (existing_credit_card->record_type() == CreditCard::MASKED_SERVER_CARD) { |
| 639 database_->UnmaskServerCreditCard(credit_card, | 639 database_->UnmaskServerCreditCard(credit_card, |
| 640 credit_card.number()); | 640 credit_card.number()); |
| 641 } else { | 641 } else { |
| 642 database_->MaskServerCreditCard(credit_card.server_id()); | 642 database_->MaskServerCreditCard(credit_card.server_id()); |
| 643 } | 643 } |
| 644 | 644 |
| 645 Refresh(); | 645 Refresh(); |
| 646 } | 646 } |
| 647 | 647 |
| 648 void PersonalDataManager::UpdateServerCardBillingAddress( | 648 void PersonalDataManager::UpdateServerCardMetadata( |
| 649 const CreditCard& credit_card) { | 649 const CreditCard& credit_card) { |
| 650 DCHECK_NE(CreditCard::LOCAL_CARD, credit_card.record_type()); | 650 DCHECK_NE(CreditCard::LOCAL_CARD, credit_card.record_type()); |
| 651 | 651 |
| 652 if (!database_.get()) | 652 if (!database_.get()) |
| 653 return; | 653 return; |
| 654 | 654 |
| 655 CreditCard* existing_credit_card = nullptr; | 655 CreditCard* existing_credit_card = nullptr; |
| 656 for (auto& server_card : server_credit_cards_) { | 656 for (auto& server_card : server_credit_cards_) { |
| 657 if (credit_card.server_id() == server_card->server_id()) { | 657 if (credit_card.server_id() == server_card->server_id()) { |
| 658 existing_credit_card = server_card.get(); | 658 existing_credit_card = server_card.get(); |
| (...skipping 1202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1861 } | 1861 } |
| 1862 | 1862 |
| 1863 // If the card was modified, apply the changes to the database. | 1863 // If the card was modified, apply the changes to the database. |
| 1864 if (was_modified) { | 1864 if (was_modified) { |
| 1865 database_->UpdateCreditCard(*credit_card); | 1865 database_->UpdateCreditCard(*credit_card); |
| 1866 } | 1866 } |
| 1867 } | 1867 } |
| 1868 } | 1868 } |
| 1869 | 1869 |
| 1870 } // namespace autofill | 1870 } // namespace autofill |
| OLD | NEW |