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

Side by Side Diff: chrome/browser/autofill/credit_card.cc

Issue 558066: Autofill dialog for the Mac. This is UI only at this point. The UI is not h... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/autofill/credit_card.h" 5 #include "chrome/browser/autofill/credit_card.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 24 matching lines...) Expand all
35 35
36 CreditCard::CreditCard(const CreditCard& card) : FormGroup() { 36 CreditCard::CreditCard(const CreditCard& card) : FormGroup() {
37 operator=(card); 37 operator=(card);
38 } 38 }
39 39
40 CreditCard::CreditCard() 40 CreditCard::CreditCard()
41 : expiration_month_(0), 41 : expiration_month_(0),
42 expiration_year_(0) { 42 expiration_year_(0) {
43 } 43 }
44 44
45
46 FormGroup* CreditCard::Clone() const { 45 FormGroup* CreditCard::Clone() const {
47 return new CreditCard(*this); 46 return new CreditCard(*this);
48 } 47 }
49 48
50 void CreditCard::GetPossibleFieldTypes(const string16& text, 49 void CreditCard::GetPossibleFieldTypes(const string16& text,
51 FieldTypeSet* possible_types) const { 50 FieldTypeSet* possible_types) const {
52 if (IsNameOnCard(text)) 51 if (IsNameOnCard(text))
53 possible_types->insert(CREDIT_CARD_NAME); 52 possible_types->insert(CREDIT_CARD_NAME);
54 53
55 if (IsCreditCardNumber(text)) 54 if (IsCreditCardNumber(text))
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 317
319 for (size_t index = 0; index < arraysize(types); ++index) { 318 for (size_t index = 0; index < arraysize(types); ++index) {
320 if (GetFieldText(AutoFillType(types[index])) != 319 if (GetFieldText(AutoFillType(types[index])) !=
321 creditcard.GetFieldText(AutoFillType(types[index]))) 320 creditcard.GetFieldText(AutoFillType(types[index])))
322 return false; 321 return false;
323 } 322 }
324 323
325 return true; 324 return true;
326 } 325 }
327 326
327 bool CreditCard::operator!=(const CreditCard& creditcard) const {
328 return !operator==(creditcard);
329 }
330
328 bool CreditCard::FindInfoMatchesHelper(const AutoFillFieldType& field_type, 331 bool CreditCard::FindInfoMatchesHelper(const AutoFillFieldType& field_type,
329 const string16& info, 332 const string16& info,
330 string16* match) const { 333 string16* match) const {
331 if (match == NULL) { 334 if (match == NULL) {
332 DLOG(ERROR) << "NULL match string passed in"; 335 DLOG(ERROR) << "NULL match string passed in";
333 return false; 336 return false;
334 } 337 }
335 338
336 match->clear(); 339 match->clear();
337 switch (field_type) { 340 switch (field_type) {
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 << " " 489 << " "
487 << UTF16ToUTF8(creditcard.GetFieldText( 490 << UTF16ToUTF8(creditcard.GetFieldText(
488 AutoFillType(CREDIT_CARD_VERIFICATION_CODE))) 491 AutoFillType(CREDIT_CARD_VERIFICATION_CODE)))
489 << " " 492 << " "
490 << UTF16ToUTF8(creditcard.GetFieldText( 493 << UTF16ToUTF8(creditcard.GetFieldText(
491 AutoFillType(CREDIT_CARD_EXP_MONTH))) 494 AutoFillType(CREDIT_CARD_EXP_MONTH)))
492 << " " 495 << " "
493 << UTF16ToUTF8(creditcard.GetFieldText( 496 << UTF16ToUTF8(creditcard.GetFieldText(
494 AutoFillType(CREDIT_CARD_EXP_4_DIGIT_YEAR))); 497 AutoFillType(CREDIT_CARD_EXP_4_DIGIT_YEAR)));
495 } 498 }
OLDNEW
« no previous file with comments | « chrome/browser/autofill/credit_card.h ('k') | chrome/browser/cocoa/disclosure_view_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698