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 1797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1808 const std::unordered_map<std::string, std::string>& guids_merge_map) { | 1808 const std::unordered_map<std::string, std::string>& guids_merge_map) { |
1809 /* Here is an example of what the graph might look like. | 1809 /* Here is an example of what the graph might look like. |
1810 | 1810 |
1811 A -> B | 1811 A -> B |
1812 \ | 1812 \ |
1813 -> E | 1813 -> E |
1814 / | 1814 / |
1815 C -> D | 1815 C -> D |
1816 */ | 1816 */ |
1817 | 1817 |
1818 for (auto& credit_card : GetCreditCards()) { | 1818 for (auto* credit_card : GetCreditCards()) { |
1819 // If the credit card is not associated with a billing address, skip it. | 1819 // If the credit card is not associated with a billing address, skip it. |
1820 if (credit_card->billing_address_id().empty()) | 1820 if (credit_card->billing_address_id().empty()) |
1821 break; | 1821 break; |
1822 | 1822 |
1823 // If the billing address profile associated with the card has been merged, | 1823 // If the billing address profile associated with the card has been merged, |
1824 // replace it by the id of the profile in which it was merged. Repeat the | 1824 // replace it by the id of the profile in which it was merged. Repeat the |
1825 // process until the billing address has not been merged into another one. | 1825 // process until the billing address has not been merged into another one. |
1826 std::unordered_map<std::string, std::string>::size_type nb_guid_changes = 0; | 1826 std::unordered_map<std::string, std::string>::size_type nb_guid_changes = 0; |
1827 bool was_modified = false; | 1827 bool was_modified = false; |
1828 auto it = guids_merge_map.find(credit_card->billing_address_id()); | 1828 auto it = guids_merge_map.find(credit_card->billing_address_id()); |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1939 existing_profiles->back().SetRawInfo(EMAIL_ADDRESS, email); | 1939 existing_profiles->back().SetRawInfo(EMAIL_ADDRESS, email); |
1940 | 1940 |
1941 AutofillMetrics::LogWalletAddressConversionType( | 1941 AutofillMetrics::LogWalletAddressConversionType( |
1942 AutofillMetrics::CONVERTED_ADDRESS_ADDED); | 1942 AutofillMetrics::CONVERTED_ADDRESS_ADDED); |
1943 } | 1943 } |
1944 | 1944 |
1945 return guid; | 1945 return guid; |
1946 } | 1946 } |
1947 | 1947 |
1948 } // namespace autofill | 1948 } // namespace autofill |
OLD | NEW |