Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: components/autofill/core/browser/personal_data_manager.cc

Issue 2671813005: [Autofill] Use user's email for converted wallet addresses. (Closed)
Patch Set: Addressed comment Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | components/autofill/core/browser/personal_data_manager_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1900 matching lines...) Expand 10 before | Expand all | Expand 10 after
1911 } 1911 }
1912 } 1912 }
1913 1913
1914 // If the server address was not merged with a local profile, add it to the 1914 // If the server address was not merged with a local profile, add it to the
1915 // list. 1915 // list.
1916 if (!matching_profile_found) { 1916 if (!matching_profile_found) {
1917 existing_profiles->push_back(server_address); 1917 existing_profiles->push_back(server_address);
1918 // Set the profile as being local. 1918 // Set the profile as being local.
1919 existing_profiles->back().set_record_type(AutofillProfile::LOCAL_PROFILE); 1919 existing_profiles->back().set_record_type(AutofillProfile::LOCAL_PROFILE);
1920 existing_profiles->back().set_modification_date(AutofillClock::Now()); 1920 existing_profiles->back().set_modification_date(AutofillClock::Now());
1921
1922 // Wallet addresses don't have an email address, use the one from the
1923 // currently signed-in account.
1924 std::string account_id = signin_manager_->GetAuthenticatedAccountId();
1925 base::string16 email =
1926 base::UTF8ToUTF16(account_tracker_->GetAccountInfo(account_id).email);
1927 if (!email.empty())
1928 existing_profiles->back().SetRawInfo(EMAIL_ADDRESS, email);
1929
1921 AutofillMetrics::LogWalletAddressConversionType( 1930 AutofillMetrics::LogWalletAddressConversionType(
1922 AutofillMetrics::CONVERTED_ADDRESS_ADDED); 1931 AutofillMetrics::CONVERTED_ADDRESS_ADDED);
1923 } 1932 }
1924 1933
1925 return guid; 1934 return guid;
1926 } 1935 }
1927 1936
1928 } // namespace autofill 1937 } // namespace autofill
OLDNEW
« no previous file with comments | « no previous file | components/autofill/core/browser/personal_data_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698