Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/autofill_manager.h" | 5 #include "chrome/browser/autofill/autofill_manager.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
| (...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 681 | 681 |
| 682 void AutoFillManager::FillCreditCardFormField(const CreditCard* credit_card, | 682 void AutoFillManager::FillCreditCardFormField(const CreditCard* credit_card, |
| 683 AutoFillType type, | 683 AutoFillType type, |
| 684 webkit_glue::FormField* field) { | 684 webkit_glue::FormField* field) { |
| 685 DCHECK(credit_card); | 685 DCHECK(credit_card); |
| 686 DCHECK(type.group() == AutoFillType::CREDIT_CARD); | 686 DCHECK(type.group() == AutoFillType::CREDIT_CARD); |
| 687 DCHECK(field); | 687 DCHECK(field); |
| 688 | 688 |
| 689 if (field->form_control_type() == ASCIIToUTF16("select-one")) | 689 if (field->form_control_type() == ASCIIToUTF16("select-one")) |
| 690 autofill::FillSelectControl(credit_card, type, field); | 690 autofill::FillSelectControl(credit_card, type, field); |
| 691 else if (field->form_control_type() == ASCIIToUTF16("month")) | |
| 692 // THML5 input="month" consisnts of year-month. | |
|
James Hawkins
2011/01/03 19:50:00
Spelling errors in this comment.
| |
| 693 field->set_value( | |
| 694 credit_card->GetFieldText(AutoFillType(CREDIT_CARD_EXP_4_DIGIT_YEAR)) + | |
|
James Hawkins
2011/01/03 19:50:00
Please extract a variable from these lines and sen
| |
| 695 string16(ASCIIToUTF16("-")) + | |
|
James Hawkins
2011/01/03 19:50:00
No need to wrap with string16().
| |
| 696 credit_card->GetFieldText(AutoFillType(CREDIT_CARD_EXP_MONTH))); | |
| 691 else | 697 else |
| 692 field->set_value(credit_card->GetFieldText(type)); | 698 field->set_value(credit_card->GetFieldText(type)); |
| 693 } | 699 } |
| 694 | 700 |
| 695 void AutoFillManager::FillFormField(const AutoFillProfile* profile, | 701 void AutoFillManager::FillFormField(const AutoFillProfile* profile, |
| 696 AutoFillType type, | 702 AutoFillType type, |
| 697 webkit_glue::FormField* field) { | 703 webkit_glue::FormField* field) { |
| 698 DCHECK(profile); | 704 DCHECK(profile); |
| 699 DCHECK(type.group() != AutoFillType::CREDIT_CARD); | 705 DCHECK(type.group() != AutoFillType::CREDIT_CARD); |
| 700 DCHECK(field); | 706 DCHECK(field); |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 810 return std::string(); | 816 return std::string(); |
| 811 | 817 |
| 812 std::map<int, std::string>::const_iterator iter = id_guid_map_.find(id); | 818 std::map<int, std::string>::const_iterator iter = id_guid_map_.find(id); |
| 813 if (iter == id_guid_map_.end()) { | 819 if (iter == id_guid_map_.end()) { |
| 814 NOTREACHED(); | 820 NOTREACHED(); |
| 815 return std::string(); | 821 return std::string(); |
| 816 } | 822 } |
| 817 | 823 |
| 818 return iter->second; | 824 return iter->second; |
| 819 } | 825 } |
| OLD | NEW |