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

Side by Side Diff: chrome/browser/extensions/api/autofill_private/autofill_util.cc

Issue 1694443004: [Autofill] Add credit card first and last name heuristics predictions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 9 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
OLDNEW
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 #include <utility> 8 #include <utility>
9 9
10 #include "base/strings/string_split.h" 10 #include "base/strings/string_split.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 } 112 }
113 113
114 scoped_ptr<autofill_private::CreditCardEntry> CreditCardToCreditCardEntry( 114 scoped_ptr<autofill_private::CreditCardEntry> CreditCardToCreditCardEntry(
115 const autofill::CreditCard& credit_card) { 115 const autofill::CreditCard& credit_card) {
116 scoped_ptr<autofill_private::CreditCardEntry> 116 scoped_ptr<autofill_private::CreditCardEntry>
117 card(new autofill_private::CreditCardEntry); 117 card(new autofill_private::CreditCardEntry);
118 118
119 // Add all credit card fields to the entry. 119 // Add all credit card fields to the entry.
120 card->guid.reset(new std::string(credit_card.guid())); 120 card->guid.reset(new std::string(credit_card.guid()));
121 card->name.reset(new std::string(base::UTF16ToUTF8( 121 card->name.reset(new std::string(base::UTF16ToUTF8(
122 credit_card.GetRawInfo(autofill::CREDIT_CARD_NAME)))); 122 credit_card.GetRawInfo(autofill::CREDIT_CARD_NAME_FULL))));
123 card->card_number.reset(new std::string(base::UTF16ToUTF8( 123 card->card_number.reset(new std::string(base::UTF16ToUTF8(
124 credit_card.GetRawInfo(autofill::CREDIT_CARD_NUMBER)))); 124 credit_card.GetRawInfo(autofill::CREDIT_CARD_NUMBER))));
125 card->expiration_month.reset(new std::string(base::UTF16ToUTF8( 125 card->expiration_month.reset(new std::string(base::UTF16ToUTF8(
126 credit_card.GetRawInfo(autofill::CREDIT_CARD_EXP_MONTH)))); 126 credit_card.GetRawInfo(autofill::CREDIT_CARD_EXP_MONTH))));
127 card->expiration_year.reset(new std::string(base::UTF16ToUTF8( 127 card->expiration_year.reset(new std::string(base::UTF16ToUTF8(
128 credit_card.GetRawInfo(autofill::CREDIT_CARD_EXP_4_DIGIT_YEAR)))); 128 credit_card.GetRawInfo(autofill::CREDIT_CARD_EXP_4_DIGIT_YEAR))));
129 129
130 // Create address metadata and add it to |address|. 130 // Create address metadata and add it to |address|.
131 scoped_ptr<autofill_private::AutofillMetadata> 131 scoped_ptr<autofill_private::AutofillMetadata>
132 metadata(new autofill_private::AutofillMetadata); 132 metadata(new autofill_private::AutofillMetadata);
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 CreditCardToCreditCardEntry(*card).release(); 182 CreditCardToCreditCardEntry(*card).release();
183 list->push_back(linked_ptr<autofill_private::CreditCardEntry>(entry)); 183 list->push_back(linked_ptr<autofill_private::CreditCardEntry>(entry));
184 } 184 }
185 185
186 return list; 186 return list;
187 } 187 }
188 188
189 } // namespace autofill_util 189 } // namespace autofill_util
190 190
191 } // namespace extensions 191 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698