| 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 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 582 | 582 |
| 583 // Don't overwrite the origin for a credit card that is already stored. | 583 // Don't overwrite the origin for a credit card that is already stored. |
| 584 if (existing_credit_card->Compare(credit_card) == 0) | 584 if (existing_credit_card->Compare(credit_card) == 0) |
| 585 return; | 585 return; |
| 586 | 586 |
| 587 if (credit_card.IsEmpty(app_locale_)) { | 587 if (credit_card.IsEmpty(app_locale_)) { |
| 588 RemoveByGUID(credit_card.guid()); | 588 RemoveByGUID(credit_card.guid()); |
| 589 return; | 589 return; |
| 590 } | 590 } |
| 591 | 591 |
| 592 // Update the cached version. |
| 593 *existing_credit_card = credit_card; |
| 594 |
| 592 if (!database_.get()) | 595 if (!database_.get()) |
| 593 return; | 596 return; |
| 594 | 597 |
| 595 // Make the update. | 598 // Make the update. |
| 596 database_->UpdateCreditCard(credit_card); | 599 database_->UpdateCreditCard(credit_card); |
| 597 | 600 |
| 598 // Refresh our local cache and send notifications to observers. | 601 // Refresh our local cache and send notifications to observers. |
| 599 Refresh(); | 602 Refresh(); |
| 600 } | 603 } |
| 601 | 604 |
| (...skipping 1186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1788 if (profile_to_merge->IsVerified()) | 1791 if (profile_to_merge->IsVerified()) |
| 1789 break; | 1792 break; |
| 1790 } | 1793 } |
| 1791 } | 1794 } |
| 1792 } | 1795 } |
| 1793 AutofillMetrics::LogNumberOfProfilesRemovedDuringDedupe( | 1796 AutofillMetrics::LogNumberOfProfilesRemovedDuringDedupe( |
| 1794 profiles_to_delete->size()); | 1797 profiles_to_delete->size()); |
| 1795 } | 1798 } |
| 1796 | 1799 |
| 1797 } // namespace autofill | 1800 } // namespace autofill |
| OLD | NEW |