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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 | 225 |
226 if (autocomplete_attribute_value == "country") | 226 if (autocomplete_attribute_value == "country") |
227 return HTML_TYPE_COUNTRY_CODE; | 227 return HTML_TYPE_COUNTRY_CODE; |
228 | 228 |
229 if (autocomplete_attribute_value == "country-name") | 229 if (autocomplete_attribute_value == "country-name") |
230 return HTML_TYPE_COUNTRY_NAME; | 230 return HTML_TYPE_COUNTRY_NAME; |
231 | 231 |
232 if (autocomplete_attribute_value == "postal-code") | 232 if (autocomplete_attribute_value == "postal-code") |
233 return HTML_TYPE_POSTAL_CODE; | 233 return HTML_TYPE_POSTAL_CODE; |
234 | 234 |
| 235 // content_switches.h isn't accessible from here, hence we have |
| 236 // to copy the string literal. This should be removed soon anyway. |
| 237 if (autocomplete_attribute_value == "address" && |
| 238 CommandLine::ForCurrentProcess()->HasSwitch( |
| 239 "enable-experimental-web-platform-features")) { |
| 240 return HTML_TYPE_FULL_ADDRESS; |
| 241 } |
| 242 |
235 if (autocomplete_attribute_value == "cc-name") | 243 if (autocomplete_attribute_value == "cc-name") |
236 return HTML_TYPE_CREDIT_CARD_NAME; | 244 return HTML_TYPE_CREDIT_CARD_NAME; |
237 | 245 |
238 if (autocomplete_attribute_value == "cc-number") | 246 if (autocomplete_attribute_value == "cc-number") |
239 return HTML_TYPE_CREDIT_CARD_NUMBER; | 247 return HTML_TYPE_CREDIT_CARD_NUMBER; |
240 | 248 |
241 if (autocomplete_attribute_value == "cc-exp") { | 249 if (autocomplete_attribute_value == "cc-exp") { |
242 if (field.max_length == 5) | 250 if (field.max_length == 5) |
243 return HTML_TYPE_CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR; | 251 return HTML_TYPE_CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR; |
244 else if (field.max_length == 7) | 252 else if (field.max_length == 7) |
(...skipping 952 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1197 field != fields_.end(); ++field) { | 1205 field != fields_.end(); ++field) { |
1198 FieldTypeGroup field_type_group = (*field)->Type().group(); | 1206 FieldTypeGroup field_type_group = (*field)->Type().group(); |
1199 if (field_type_group == CREDIT_CARD) | 1207 if (field_type_group == CREDIT_CARD) |
1200 (*field)->set_section((*field)->section() + "-cc"); | 1208 (*field)->set_section((*field)->section() + "-cc"); |
1201 else | 1209 else |
1202 (*field)->set_section((*field)->section() + "-default"); | 1210 (*field)->set_section((*field)->section() + "-default"); |
1203 } | 1211 } |
1204 } | 1212 } |
1205 | 1213 |
1206 } // namespace autofill | 1214 } // namespace autofill |
OLD | NEW |