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, | |
1111 const std::string& app_locale) { | 1110 const std::string& app_locale) { |
1112 bool filled_something = false; | 1111 bool filled_something = false; |
1113 for (size_t i = 0; i < field_count(); ++i) { | 1112 for (size_t i = 0; i < field_count(); ++i) { |
1114 for (size_t j = 0; j < types.size(); ++j) { | 1113 for (size_t j = 0; j < types.size(); ++j) { |
1115 if (matches.Run(types[j], *field(i))) { | 1114 if (matches.Run(types[j], *field(i))) { |
1116 AutofillField::FillFormField(*field(i), | 1115 AutofillField::FillFormField(*field(i), |
1117 get_info.Run(field(i)->Type()), | 1116 get_info.Run(field(i)->Type()), |
1118 address_language_code, | |
1119 app_locale, | 1117 app_locale, |
1120 field(i)); | 1118 field(i)); |
1121 filled_something = true; | 1119 filled_something = true; |
1122 break; | 1120 break; |
1123 } | 1121 } |
1124 } | 1122 } |
1125 } | 1123 } |
1126 return filled_something; | 1124 return filled_something; |
1127 } | 1125 } |
1128 | 1126 |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1228 field != fields_.end(); ++field) { | 1226 field != fields_.end(); ++field) { |
1229 FieldTypeGroup field_type_group = (*field)->Type().group(); | 1227 FieldTypeGroup field_type_group = (*field)->Type().group(); |
1230 if (field_type_group == CREDIT_CARD) | 1228 if (field_type_group == CREDIT_CARD) |
1231 (*field)->set_section((*field)->section() + "-cc"); | 1229 (*field)->set_section((*field)->section() + "-cc"); |
1232 else | 1230 else |
1233 (*field)->set_section((*field)->section() + "-default"); | 1231 (*field)->set_section((*field)->section() + "-default"); |
1234 } | 1232 } |
1235 } | 1233 } |
1236 | 1234 |
1237 } // namespace autofill | 1235 } // namespace autofill |
OLD | NEW |