| OLD | NEW |
| 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/credit_card.h" | 5 #include "components/autofill/core/browser/credit_card.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <ostream> | 9 #include <ostream> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 expiration_month_ = imported_card.expiration_month_; | 526 expiration_month_ = imported_card.expiration_month_; |
| 527 expiration_year_ = imported_card.expiration_year_; | 527 expiration_year_ = imported_card.expiration_year_; |
| 528 | 528 |
| 529 return true; | 529 return true; |
| 530 } | 530 } |
| 531 | 531 |
| 532 void CreditCard::FillFormField(const AutofillField& field, | 532 void CreditCard::FillFormField(const AutofillField& field, |
| 533 size_t /*variant*/, | 533 size_t /*variant*/, |
| 534 const std::string& app_locale, | 534 const std::string& app_locale, |
| 535 FormFieldData* field_data) const { | 535 FormFieldData* field_data) const { |
| 536 DCHECK_EQ(AutofillType::CREDIT_CARD, AutofillType(field.type()).group()); | 536 DCHECK_EQ(CREDIT_CARD, AutofillType(field.type()).group()); |
| 537 DCHECK(field_data); | 537 DCHECK(field_data); |
| 538 | 538 |
| 539 if (field_data->form_control_type == "select-one") { | 539 if (field_data->form_control_type == "select-one") { |
| 540 FillSelectControl(field.type(), app_locale, field_data); | 540 FillSelectControl(field.type(), app_locale, field_data); |
| 541 } else if (field_data->form_control_type == "month") { | 541 } else if (field_data->form_control_type == "month") { |
| 542 // HTML5 input="month" consists of year-month. | 542 // HTML5 input="month" consists of year-month. |
| 543 base::string16 year = GetInfo(CREDIT_CARD_EXP_4_DIGIT_YEAR, app_locale); | 543 base::string16 year = GetInfo(CREDIT_CARD_EXP_4_DIGIT_YEAR, app_locale); |
| 544 base::string16 month = GetInfo(CREDIT_CARD_EXP_MONTH, app_locale); | 544 base::string16 month = GetInfo(CREDIT_CARD_EXP_MONTH, app_locale); |
| 545 if (!year.empty() && !month.empty()) { | 545 if (!year.empty() && !month.empty()) { |
| 546 // Fill the value only if |this| includes both year and month | 546 // Fill the value only if |this| includes both year and month |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 701 const char* const kAmericanExpressCard = "americanExpressCC"; | 701 const char* const kAmericanExpressCard = "americanExpressCC"; |
| 702 const char* const kDinersCard = "dinersCC"; | 702 const char* const kDinersCard = "dinersCC"; |
| 703 const char* const kDiscoverCard = "discoverCC"; | 703 const char* const kDiscoverCard = "discoverCC"; |
| 704 const char* const kGenericCard = "genericCC"; | 704 const char* const kGenericCard = "genericCC"; |
| 705 const char* const kJCBCard = "jcbCC"; | 705 const char* const kJCBCard = "jcbCC"; |
| 706 const char* const kMasterCard = "masterCardCC"; | 706 const char* const kMasterCard = "masterCardCC"; |
| 707 const char* const kUnionPay = "unionPayCC"; | 707 const char* const kUnionPay = "unionPayCC"; |
| 708 const char* const kVisaCard = "visaCC"; | 708 const char* const kVisaCard = "visaCC"; |
| 709 | 709 |
| 710 } // namespace autofill | 710 } // namespace autofill |
| OLD | NEW |