| 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 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 690 form_signature_field_names_; | 690 form_signature_field_names_; |
| 691 | 691 |
| 692 return Hash64Bit(form_string); | 692 return Hash64Bit(form_string); |
| 693 } | 693 } |
| 694 | 694 |
| 695 bool FormStructure::IsAutocheckoutEnabled() const { | 695 bool FormStructure::IsAutocheckoutEnabled() const { |
| 696 return !autocheckout_url_prefix_.empty(); | 696 return !autocheckout_url_prefix_.empty(); |
| 697 } | 697 } |
| 698 | 698 |
| 699 bool FormStructure::ShouldSkipField(const FormFieldData& field) const { | 699 bool FormStructure::ShouldSkipField(const FormFieldData& field) const { |
| 700 return (field.is_checkable || field.form_control_type == "password") && | 700 return field.is_checkable && !IsAutocheckoutEnabled(); |
| 701 !IsAutocheckoutEnabled(); | |
| 702 } | 701 } |
| 703 | 702 |
| 704 size_t FormStructure::RequiredFillableFields() const { | 703 size_t FormStructure::RequiredFillableFields() const { |
| 705 return IsAutocheckoutEnabled() ? 0 : kRequiredAutofillFields; | 704 return IsAutocheckoutEnabled() ? 0 : kRequiredAutofillFields; |
| 706 } | 705 } |
| 707 | 706 |
| 708 bool FormStructure::IsAutofillable(bool require_method_post) const { | 707 bool FormStructure::IsAutofillable(bool require_method_post) const { |
| 709 if (autofill_count() < RequiredFillableFields()) | 708 if (autofill_count() < RequiredFillableFields()) |
| 710 return false; | 709 return false; |
| 711 | 710 |
| (...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1250 field != fields_.end(); ++field) { | 1249 field != fields_.end(); ++field) { |
| 1251 FieldTypeGroup field_type_group = (*field)->Type().group(); | 1250 FieldTypeGroup field_type_group = (*field)->Type().group(); |
| 1252 if (field_type_group == CREDIT_CARD) | 1251 if (field_type_group == CREDIT_CARD) |
| 1253 (*field)->set_section((*field)->section() + "-cc"); | 1252 (*field)->set_section((*field)->section() + "-cc"); |
| 1254 else | 1253 else |
| 1255 (*field)->set_section((*field)->section() + "-default"); | 1254 (*field)->set_section((*field)->section() + "-default"); |
| 1256 } | 1255 } |
| 1257 } | 1256 } |
| 1258 | 1257 |
| 1259 } // namespace autofill | 1258 } // namespace autofill |
| OLD | NEW |