| 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 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 735 if (cached_field != cached_fields.end()) { | 735 if (cached_field != cached_fields.end()) { |
| 736 if (field->form_control_type != "select-one" && | 736 if (field->form_control_type != "select-one" && |
| 737 field->value == cached_field->second->value) { | 737 field->value == cached_field->second->value) { |
| 738 // From the perspective of learning user data, text fields containing | 738 // From the perspective of learning user data, text fields containing |
| 739 // default values are equivalent to empty fields. | 739 // default values are equivalent to empty fields. |
| 740 field->value = base::string16(); | 740 field->value = base::string16(); |
| 741 } | 741 } |
| 742 | 742 |
| 743 field->set_heuristic_type(cached_field->second->heuristic_type()); | 743 field->set_heuristic_type(cached_field->second->heuristic_type()); |
| 744 field->set_server_type(cached_field->second->server_type()); | 744 field->set_server_type(cached_field->second->server_type()); |
| 745 field->SetHtmlType(cached_field->second->html_type(), |
| 746 cached_field->second->html_mode()); |
| 745 } | 747 } |
| 746 } | 748 } |
| 747 | 749 |
| 748 UpdateAutofillCount(); | 750 UpdateAutofillCount(); |
| 749 | 751 |
| 750 // The form signature should match between query and upload requests to the | 752 // The form signature should match between query and upload requests to the |
| 751 // server. On many websites, form elements are dynamically added, removed, or | 753 // server. On many websites, form elements are dynamically added, removed, or |
| 752 // rearranged via JavaScript between page load and form submission, so we | 754 // rearranged via JavaScript between page load and form submission, so we |
| 753 // copy over the |form_signature_field_names_| corresponding to the query | 755 // copy over the |form_signature_field_names_| corresponding to the query |
| 754 // request. | 756 // request. |
| (...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1245 for (AutofillField* field : fields_) { | 1247 for (AutofillField* field : fields_) { |
| 1246 FieldTypeGroup field_type_group = field->Type().group(); | 1248 FieldTypeGroup field_type_group = field->Type().group(); |
| 1247 if (field_type_group == CREDIT_CARD) | 1249 if (field_type_group == CREDIT_CARD) |
| 1248 field->set_section(field->section() + "-cc"); | 1250 field->set_section(field->section() + "-cc"); |
| 1249 else | 1251 else |
| 1250 field->set_section(field->section() + "-default"); | 1252 field->set_section(field->section() + "-default"); |
| 1251 } | 1253 } |
| 1252 } | 1254 } |
| 1253 | 1255 |
| 1254 } // namespace autofill | 1256 } // namespace autofill |
| OLD | NEW |