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 884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
895 // verified profile, just drop it. | 895 // verified profile, just drop it. |
896 matching_profile_found = true; | 896 matching_profile_found = true; |
897 guid = existing_profile->guid(); | 897 guid = existing_profile->guid(); |
898 | 898 |
899 // We set the modification date so that immediate requests for profiles | 899 // We set the modification date so that immediate requests for profiles |
900 // will properly reflect the fact that this profile has been modified | 900 // will properly reflect the fact that this profile has been modified |
901 // recently. After writing to the database and refreshing the local copies | 901 // recently. After writing to the database and refreshing the local copies |
902 // the profile will have a very slightly newer time reflecting what's | 902 // the profile will have a very slightly newer time reflecting what's |
903 // actually stored in the database. | 903 // actually stored in the database. |
904 existing_profile->set_modification_date(base::Time::Now()); | 904 existing_profile->set_modification_date(base::Time::Now()); |
905 | |
906 existing_profile->RecordAndLogUse(); | |
907 } | 905 } |
908 merged_profiles->push_back(*existing_profile); | 906 merged_profiles->push_back(*existing_profile); |
909 } | 907 } |
910 | 908 |
911 // If the new profile was not merged with an existing one, add it to the list. | 909 // If the new profile was not merged with an existing one, add it to the list. |
912 if (!matching_profile_found) { | 910 if (!matching_profile_found) { |
913 merged_profiles->push_back(new_profile); | 911 merged_profiles->push_back(new_profile); |
914 // Similar to updating merged profiles above, set the modification date on | 912 // Similar to updating merged profiles above, set the modification date on |
915 // new profiles. | 913 // new profiles. |
916 merged_profiles->back().set_modification_date(base::Time::Now()); | 914 merged_profiles->back().set_modification_date(base::Time::Now()); |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1508 std::stable_sort(suggestions.begin(), suggestions.end(), | 1506 std::stable_sort(suggestions.begin(), suggestions.end(), |
1509 [](const Suggestion& a, const Suggestion& b) { | 1507 [](const Suggestion& a, const Suggestion& b) { |
1510 return a.match < b.match; | 1508 return a.match < b.match; |
1511 }); | 1509 }); |
1512 } | 1510 } |
1513 | 1511 |
1514 return suggestions; | 1512 return suggestions; |
1515 } | 1513 } |
1516 | 1514 |
1517 } // namespace autofill | 1515 } // namespace autofill |
OLD | NEW |