#include "components/autofill/core/browser/form_structure_sectioning_util.h"
#include <iterator>
#include <memory>
#include <sstream>
#include <utility>
#include "base/ranges/algorithm.h"
#include "components/autofill/core/browser/autofill_field.h"
#include "components/autofill/core/browser/field_types.h"
#include "components/autofill/core/common/autofill_features.h"
namespace autofill {
namespace {
bool HaveSeenSimilarType(FieldType type, const FieldTypeSet& seen_types) { … }
bool ConsecutiveSimilarFieldType(FieldType current_type,
FieldType previous_type) { … }
bool IsSectionable(const AutofillField& field) { … }
void AssignCreditCardSections(
base::span<const std::unique_ptr<AutofillField>> fields,
base::flat_map<LocalFrameToken, size_t>& frame_token_ids) { … }
void AssignAutocompleteSections(
base::span<const std::unique_ptr<AutofillField>> fields) { … }
void AssignFieldIdentifierSections(
base::span<const std::unique_ptr<AutofillField>> section,
base::flat_map<LocalFrameToken, size_t>& frame_token_ids) { … }
bool BelongsToCurrentSection(const FieldTypeSet& seen_types,
const AutofillField& current_field,
const AutofillField& previous_field) { … }
base::span<const std::unique_ptr<AutofillField>>::iterator
FindBeginOfNextSection(
base::span<const std::unique_ptr<AutofillField>>::iterator begin,
base::span<const std::unique_ptr<AutofillField>>::iterator end) { … }
base::span<const std::unique_ptr<AutofillField>>::iterator FindEndOfNextSection(
base::span<const std::unique_ptr<AutofillField>>::iterator begin,
base::span<const std::unique_ptr<AutofillField>>::iterator end) { … }
}
void AssignSections(base::span<const std::unique_ptr<AutofillField>> fields) { … }
void LogSectioningMetrics(
FormSignature form_signature,
base::span<const std::unique_ptr<AutofillField>> fields,
AutofillMetrics::FormInteractionsUkmLogger* form_interactions_ukm_logger) { … }
uint32_t ComputeSectioningSignature(
base::span<const std::unique_ptr<AutofillField>> fields) { … }
}