| 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 1898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1909 } | 1909 } |
| 1910 } | 1910 } |
| 1911 | 1911 |
| 1912 // If the server address was not merged with a local profile, add it to the | 1912 // If the server address was not merged with a local profile, add it to the |
| 1913 // list. | 1913 // list. |
| 1914 if (!matching_profile_found) { | 1914 if (!matching_profile_found) { |
| 1915 existing_profiles->push_back(server_address); | 1915 existing_profiles->push_back(server_address); |
| 1916 // Set the profile as being local. | 1916 // Set the profile as being local. |
| 1917 existing_profiles->back().set_record_type(AutofillProfile::LOCAL_PROFILE); | 1917 existing_profiles->back().set_record_type(AutofillProfile::LOCAL_PROFILE); |
| 1918 existing_profiles->back().set_modification_date(AutofillClock::Now()); | 1918 existing_profiles->back().set_modification_date(AutofillClock::Now()); |
| 1919 |
| 1920 // Wallet addresses don't have an email address, use the one from the |
| 1921 // currently signed-in account. |
| 1922 std::string account_id = signin_manager_->GetAuthenticatedAccountId(); |
| 1923 base::string16 email = |
| 1924 base::UTF8ToUTF16(account_tracker_->GetAccountInfo(account_id).email); |
| 1925 if (!email.empty()) |
| 1926 existing_profiles->back().SetRawInfo(EMAIL_ADDRESS, email); |
| 1927 |
| 1919 AutofillMetrics::LogWalletAddressConversionType( | 1928 AutofillMetrics::LogWalletAddressConversionType( |
| 1920 AutofillMetrics::CONVERTED_ADDRESS_ADDED); | 1929 AutofillMetrics::CONVERTED_ADDRESS_ADDED); |
| 1921 } | 1930 } |
| 1922 | 1931 |
| 1923 return guid; | 1932 return guid; |
| 1924 } | 1933 } |
| 1925 | 1934 |
| 1926 } // namespace autofill | 1935 } // namespace autofill |
| OLD | NEW |