| 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/personal_data_manager.h" | 5 #include "chrome/browser/autofill/personal_data_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <iterator> | 8 #include <iterator> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 if (!field->IsFieldFillable() || value.empty()) | 161 if (!field->IsFieldFillable() || value.empty()) |
| 162 continue; | 162 continue; |
| 163 | 163 |
| 164 AutoFillType field_type(field->type()); | 164 AutoFillType field_type(field->type()); |
| 165 FieldTypeGroup group(field_type.group()); | 165 FieldTypeGroup group(field_type.group()); |
| 166 | 166 |
| 167 if (group == AutoFillType::CREDIT_CARD) { | 167 if (group == AutoFillType::CREDIT_CARD) { |
| 168 // If the user has a password set, we have no way of setting credit | 168 // If the user has a password set, we have no way of setting credit |
| 169 // card numbers. | 169 // card numbers. |
| 170 if (!HasPassword()) { | 170 if (!HasPassword()) { |
| 171 imported_credit_card_->SetInfo(AutoFillType(field_type.field_type()), | 171 if (LowerCaseEqualsASCII(field->form_control_type(), "month")) { |
| 172 value); | 172 imported_credit_card_->SetMonthInputInfo(value); |
| 173 } else { |
| 174 imported_credit_card_->SetInfo( |
| 175 AutoFillType(field_type.field_type()), value); |
| 176 } |
| 173 ++importable_credit_card_fields; | 177 ++importable_credit_card_fields; |
| 174 } | 178 } |
| 175 } else { | 179 } else { |
| 176 // In the case of a phone number, if the whole phone number was entered | 180 // In the case of a phone number, if the whole phone number was entered |
| 177 // into a single field, then parse it and set the sub components. | 181 // into a single field, then parse it and set the sub components. |
| 178 if (field_type.subgroup() == AutoFillType::PHONE_WHOLE_NUMBER) { | 182 if (field_type.subgroup() == AutoFillType::PHONE_WHOLE_NUMBER) { |
| 179 string16 number; | 183 string16 number; |
| 180 string16 city_code; | 184 string16 city_code; |
| 181 string16 country_code; | 185 string16 country_code; |
| 182 PhoneNumber::ParsePhoneNumber(value, | 186 PhoneNumber::ParsePhoneNumber(value, |
| (...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 792 } | 796 } |
| 793 | 797 |
| 794 creditcards.push_back(**iter); | 798 creditcards.push_back(**iter); |
| 795 } | 799 } |
| 796 | 800 |
| 797 if (!merged) | 801 if (!merged) |
| 798 creditcards.push_back(*imported_credit_card_); | 802 creditcards.push_back(*imported_credit_card_); |
| 799 | 803 |
| 800 SetCreditCards(&creditcards); | 804 SetCreditCards(&creditcards); |
| 801 } | 805 } |
| OLD | NEW |