| 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 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <list> | 9 #include <list> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 917 if (!matching_profile_found && | 917 if (!matching_profile_found && |
| 918 !new_profile.PrimaryValue(app_locale_).empty() && | 918 !new_profile.PrimaryValue(app_locale_).empty() && |
| 919 existing_profile->SaveAdditionalInfo(new_profile, app_locale)) { | 919 existing_profile->SaveAdditionalInfo(new_profile, app_locale)) { |
| 920 // Unverified profiles should always be updated with the newer data, | 920 // Unverified profiles should always be updated with the newer data, |
| 921 // whereas verified profiles should only ever be overwritten by verified | 921 // whereas verified profiles should only ever be overwritten by verified |
| 922 // data. If an automatically aggregated profile would overwrite a | 922 // data. If an automatically aggregated profile would overwrite a |
| 923 // verified profile, just drop it. | 923 // verified profile, just drop it. |
| 924 matching_profile_found = true; | 924 matching_profile_found = true; |
| 925 guid = existing_profile->guid(); | 925 guid = existing_profile->guid(); |
| 926 | 926 |
| 927 // Look for duplicates of |existing_profile| to merge into. | 927 if (IsAutofillProfileCleanupEnabled()) { |
| 928 FindMergeAndDeleteDuplicateProfiles(existing_profiles, existing_profile); | 928 // Look for duplicates of |existing_profile| to merge into. |
| 929 FindMergeAndDeleteDuplicateProfiles(existing_profiles, |
| 930 existing_profile); |
| 931 } |
| 929 | 932 |
| 930 // We set the modification date so that immediate requests for profiles | 933 // We set the modification date so that immediate requests for profiles |
| 931 // will properly reflect the fact that this profile has been modified | 934 // will properly reflect the fact that this profile has been modified |
| 932 // recently. After writing to the database and refreshing the local copies | 935 // recently. After writing to the database and refreshing the local copies |
| 933 // the profile will have a very slightly newer time reflecting what's | 936 // the profile will have a very slightly newer time reflecting what's |
| 934 // actually stored in the database. | 937 // actually stored in the database. |
| 935 existing_profile->set_modification_date(base::Time::Now()); | 938 existing_profile->set_modification_date(base::Time::Now()); |
| 936 } | 939 } |
| 937 merged_profiles->push_back(*existing_profile); | 940 merged_profiles->push_back(*existing_profile); |
| 938 } | 941 } |
| (...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1576 | 1579 |
| 1577 // Now try to merge the new resulting profile with the rest of the | 1580 // Now try to merge the new resulting profile with the rest of the |
| 1578 // existing profiles. | 1581 // existing profiles. |
| 1579 profile_to_merge = existing_profile; | 1582 profile_to_merge = existing_profile; |
| 1580 } | 1583 } |
| 1581 } | 1584 } |
| 1582 } | 1585 } |
| 1583 } | 1586 } |
| 1584 | 1587 |
| 1585 } // namespace autofill | 1588 } // namespace autofill |
| OLD | NEW |