OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chrome/browser/extensions/api/autofill_private/autofill_util.h" | 5 #include "chrome/browser/extensions/api/autofill_private/autofill_util.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 for (const base::string16& value16 : values) | 55 for (const base::string16& value16 : values) |
56 list->push_back(base::UTF16ToUTF8(value16)); | 56 list->push_back(base::UTF16ToUTF8(value16)); |
57 | 57 |
58 return list; | 58 return list; |
59 } | 59 } |
60 | 60 |
61 // Gets the string corresponding to |type| from |profile|. | 61 // Gets the string corresponding to |type| from |profile|. |
62 std::unique_ptr<std::string> GetStringFromProfile( | 62 std::unique_ptr<std::string> GetStringFromProfile( |
63 const autofill::AutofillProfile& profile, | 63 const autofill::AutofillProfile& profile, |
64 const autofill::ServerFieldType& type) { | 64 const autofill::ServerFieldType& type) { |
65 return base::WrapUnique( | 65 return base::MakeUnique<std::string>( |
66 new std::string(base::UTF16ToUTF8(profile.GetRawInfo(type)))); | 66 base::UTF16ToUTF8(profile.GetRawInfo(type))); |
67 } | 67 } |
68 | 68 |
69 autofill_private::AddressEntry ProfileToAddressEntry( | 69 autofill_private::AddressEntry ProfileToAddressEntry( |
70 const autofill::AutofillProfile& profile, | 70 const autofill::AutofillProfile& profile, |
71 const base::string16& label) { | 71 const base::string16& label) { |
72 autofill_private::AddressEntry address; | 72 autofill_private::AddressEntry address; |
73 | 73 |
74 // Add all address fields to the entry. | 74 // Add all address fields to the entry. |
75 address.guid.reset(new std::string(profile.guid())); | 75 address.guid.reset(new std::string(profile.guid())); |
76 address.full_names = GetValueList(profile, autofill::NAME_FULL); | 76 address.full_names = GetValueList(profile, autofill::NAME_FULL); |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 CreditCardEntryList list; | 209 CreditCardEntryList list; |
210 for (const autofill::CreditCard* card : cards) | 210 for (const autofill::CreditCard* card : cards) |
211 list.push_back(CreditCardToCreditCardEntry(*card)); | 211 list.push_back(CreditCardToCreditCardEntry(*card)); |
212 | 212 |
213 return list; | 213 return list; |
214 } | 214 } |
215 | 215 |
216 } // namespace autofill_util | 216 } // namespace autofill_util |
217 | 217 |
218 } // namespace extensions | 218 } // namespace extensions |
OLD | NEW |