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

Side by Side Diff: components/autofill/content/browser/wallet/full_wallet.cc

Issue 22040002: [Autofill] Add a separate enumeration for HTML field type hints. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add docs Created 7 years, 4 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 | Annotate | Revision Log
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/content/browser/wallet/full_wallet.h" 5 #include "components/autofill/content/browser/wallet/full_wallet.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 return scoped_ptr<FullWallet>(new FullWallet(expiration_month, 121 return scoped_ptr<FullWallet>(new FullWallet(expiration_month,
122 expiration_year, 122 expiration_year,
123 iin, 123 iin,
124 encrypted_rest, 124 encrypted_rest,
125 billing_address.Pass(), 125 billing_address.Pass(),
126 shipping_address.Pass(), 126 shipping_address.Pass(),
127 required_actions)); 127 required_actions));
128 } 128 }
129 129
130 base::string16 FullWallet::GetInfo(const AutofillType& type) { 130 base::string16 FullWallet::GetInfo(const AutofillType& type) {
131 switch (type.native_type()) { 131 switch (type.GetEquivalentNativeType()) {
132 case CREDIT_CARD_NUMBER: 132 case CREDIT_CARD_NUMBER:
133 return UTF8ToUTF16(GetPan()); 133 return UTF8ToUTF16(GetPan());
134 134
135 case CREDIT_CARD_NAME: 135 case CREDIT_CARD_NAME:
136 return billing_address()->recipient_name(); 136 return billing_address()->recipient_name();
137 137
138 case CREDIT_CARD_VERIFICATION_CODE: 138 case CREDIT_CARD_VERIFICATION_CODE:
139 return UTF8ToUTF16(GetCvn()); 139 return UTF8ToUTF16(GetCvn());
140 140
141 case CREDIT_CARD_EXP_MONTH: 141 case CREDIT_CARD_EXP_MONTH:
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 } 287 }
288 288
289 const std::string& FullWallet::GetCvn() { 289 const std::string& FullWallet::GetCvn() {
290 if (cvn_.empty()) 290 if (cvn_.empty())
291 DecryptCardInfo(); 291 DecryptCardInfo();
292 return cvn_; 292 return cvn_;
293 } 293 }
294 294
295 } // namespace wallet 295 } // namespace wallet
296 } // namespace autofill 296 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698