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/form_structure.h" | 5 #include "components/autofill/core/browser/form_structure.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 1089 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1100 // No errors encountered while parsing! | 1100 // No errors encountered while parsing! |
1101 // Update the |field|'s type based on what was parsed from the attribute. | 1101 // Update the |field|'s type based on what was parsed from the attribute. |
1102 field->SetHtmlType(field_type, mode); | 1102 field->SetHtmlType(field_type, mode); |
1103 } | 1103 } |
1104 } | 1104 } |
1105 | 1105 |
1106 bool FormStructure::FillFields( | 1106 bool FormStructure::FillFields( |
1107 const std::vector<ServerFieldType>& types, | 1107 const std::vector<ServerFieldType>& types, |
1108 const InputFieldComparator& matches, | 1108 const InputFieldComparator& matches, |
1109 const base::Callback<base::string16(const AutofillType&)>& get_info, | 1109 const base::Callback<base::string16(const AutofillType&)>& get_info, |
| 1110 const std::string& address_language_code, |
1110 const std::string& app_locale) { | 1111 const std::string& app_locale) { |
1111 bool filled_something = false; | 1112 bool filled_something = false; |
1112 for (size_t i = 0; i < field_count(); ++i) { | 1113 for (size_t i = 0; i < field_count(); ++i) { |
1113 for (size_t j = 0; j < types.size(); ++j) { | 1114 for (size_t j = 0; j < types.size(); ++j) { |
1114 if (matches.Run(types[j], *field(i))) { | 1115 if (matches.Run(types[j], *field(i))) { |
1115 AutofillField::FillFormField(*field(i), | 1116 AutofillField::FillFormField(*field(i), |
1116 get_info.Run(field(i)->Type()), | 1117 get_info.Run(field(i)->Type()), |
| 1118 address_language_code, |
1117 app_locale, | 1119 app_locale, |
1118 field(i)); | 1120 field(i)); |
1119 filled_something = true; | 1121 filled_something = true; |
1120 break; | 1122 break; |
1121 } | 1123 } |
1122 } | 1124 } |
1123 } | 1125 } |
1124 return filled_something; | 1126 return filled_something; |
1125 } | 1127 } |
1126 | 1128 |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1226 field != fields_.end(); ++field) { | 1228 field != fields_.end(); ++field) { |
1227 FieldTypeGroup field_type_group = (*field)->Type().group(); | 1229 FieldTypeGroup field_type_group = (*field)->Type().group(); |
1228 if (field_type_group == CREDIT_CARD) | 1230 if (field_type_group == CREDIT_CARD) |
1229 (*field)->set_section((*field)->section() + "-cc"); | 1231 (*field)->set_section((*field)->section() + "-cc"); |
1230 else | 1232 else |
1231 (*field)->set_section((*field)->section() + "-default"); | 1233 (*field)->set_section((*field)->section() + "-default"); |
1232 } | 1234 } |
1233 } | 1235 } |
1234 | 1236 |
1235 } // namespace autofill | 1237 } // namespace autofill |
OLD | NEW |