OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser/form_structure.h" | 5 #include "components/autofill/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 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
651 UTF16ToUTF8(form_name_) + | 651 UTF16ToUTF8(form_name_) + |
652 form_signature_field_names_; | 652 form_signature_field_names_; |
653 | 653 |
654 return Hash64Bit(form_string); | 654 return Hash64Bit(form_string); |
655 } | 655 } |
656 | 656 |
657 bool FormStructure::IsAutocheckoutEnabled() const { | 657 bool FormStructure::IsAutocheckoutEnabled() const { |
658 return !autocheckout_url_prefix_.empty(); | 658 return !autocheckout_url_prefix_.empty(); |
659 } | 659 } |
660 | 660 |
661 bool FormStructure::ShouldSkipField(const FormFieldData field) const { | 661 bool FormStructure::ShouldSkipField(const FormFieldData& field) const { |
662 return (field.is_checkable || field.form_control_type == "password") && | 662 return (field.is_checkable || field.form_control_type == "password") && |
663 !IsAutocheckoutEnabled(); | 663 !IsAutocheckoutEnabled(); |
664 } | 664 } |
665 | 665 |
666 size_t FormStructure::RequiredFillableFields() const { | 666 size_t FormStructure::RequiredFillableFields() const { |
667 return IsAutocheckoutEnabled() ? 0 : kRequiredAutofillFields; | 667 return IsAutocheckoutEnabled() ? 0 : kRequiredAutofillFields; |
668 } | 668 } |
669 | 669 |
670 bool FormStructure::IsAutofillable(bool require_method_post) const { | 670 bool FormStructure::IsAutofillable(bool require_method_post) const { |
671 if (autofill_count() < RequiredFillableFields()) | 671 if (autofill_count() < RequiredFillableFields()) |
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1213 AutofillType::FieldTypeGroup field_type_group = | 1213 AutofillType::FieldTypeGroup field_type_group = |
1214 AutofillType((*field)->type()).group(); | 1214 AutofillType((*field)->type()).group(); |
1215 if (field_type_group == AutofillType::CREDIT_CARD) | 1215 if (field_type_group == AutofillType::CREDIT_CARD) |
1216 (*field)->set_section((*field)->section() + "-cc"); | 1216 (*field)->set_section((*field)->section() + "-cc"); |
1217 else | 1217 else |
1218 (*field)->set_section((*field)->section() + "-default"); | 1218 (*field)->set_section((*field)->section() + "-default"); |
1219 } | 1219 } |
1220 } | 1220 } |
1221 | 1221 |
1222 } // namespace autofill | 1222 } // namespace autofill |
OLD | NEW |