| 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/autofill_field.h" | 5 #include "components/autofill/core/browser/autofill_field.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/i18n/string_search.h" | 10 #include "base/i18n/string_search.h" |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 field->value = field->option_values[i]; | 132 field->value = field->option_values[i]; |
| 133 return true; | 133 return true; |
| 134 } | 134 } |
| 135 } | 135 } |
| 136 | 136 |
| 137 return false; | 137 return false; |
| 138 } | 138 } |
| 139 | 139 |
| 140 bool FillStateSelectControl(const base::string16& value, | 140 bool FillStateSelectControl(const base::string16& value, |
| 141 FormFieldData* field) { | 141 FormFieldData* field) { |
| 142 base::string16 full, abbreviation; | 142 base::string16 full; |
| 143 base::string16 abbreviation; |
| 143 state_names::GetNameAndAbbreviation(value, &full, &abbreviation); | 144 state_names::GetNameAndAbbreviation(value, &full, &abbreviation); |
| 144 | 145 |
| 145 // Try an exact match of the abbreviation first. | 146 // Try an exact match of the abbreviation first. |
| 146 if (!abbreviation.empty() && SetSelectControlValue(abbreviation, field)) { | 147 if (!abbreviation.empty() && SetSelectControlValue(abbreviation, field)) { |
| 147 return true; | 148 return true; |
| 148 } | 149 } |
| 149 | 150 |
| 150 // Try an exact match of the full name. | 151 // Try an exact match of the full name. |
| 151 if (!full.empty() && SetSelectControlValue(full, field)) { | 152 if (!full.empty() && SetSelectControlValue(full, field)) { |
| 152 return true; | 153 return true; |
| (...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 645 } | 646 } |
| 646 return best_match; | 647 return best_match; |
| 647 } | 648 } |
| 648 | 649 |
| 649 bool AutofillField::IsCreditCardPrediction() const { | 650 bool AutofillField::IsCreditCardPrediction() const { |
| 650 return AutofillType(server_type_).group() == CREDIT_CARD || | 651 return AutofillType(server_type_).group() == CREDIT_CARD || |
| 651 AutofillType(heuristic_type_).group() == CREDIT_CARD; | 652 AutofillType(heuristic_type_).group() == CREDIT_CARD; |
| 652 } | 653 } |
| 653 | 654 |
| 654 } // namespace autofill | 655 } // namespace autofill |
| OLD | NEW |