#include "components/autofill/core/common/form_field_data.h"
#include <algorithm>
#include <optional>
#include <tuple>
#include "base/notreached.h"
#include "base/pickle.h"
#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/types/cxx23_to_underlying.h"
#include "build/build_config.h"
#include "components/autofill/core/common/autofill_features.h"
#include "components/autofill/core/common/autofill_util.h"
#include "components/autofill/core/common/logging/log_buffer.h"
namespace autofill {
namespace {
const int kFormFieldDataPickleVersion = …;
void WriteSelectOption(const SelectOption& option, base::Pickle* pickle) { … }
bool ReadSelectOption(base::PickleIterator* iter, SelectOption* option) { … }
void WriteSelectOptionVector(const std::vector<SelectOption>& options,
base::Pickle* pickle) { … }
bool ReadSelectOptionVector(base::PickleIterator* iter,
std::vector<SelectOption>* options) { … }
bool ReadStringVector(base::PickleIterator* iter,
std::vector<std::u16string>* strings) { … }
template <typename T>
bool ReadAsInt(base::PickleIterator* iter, T* target_value) { … }
bool DeserializeSection1(base::PickleIterator* iter,
FormFieldData* field_data) { … }
bool DeserializeSection5(base::PickleIterator* iter,
FormFieldData* field_data) { … }
bool DeserializeSection6(base::PickleIterator* iter,
FormFieldData* field_data) { … }
bool DeserializeSection7(base::PickleIterator* iter,
FormFieldData* field_data) { … }
bool DeserializeSection3(base::PickleIterator* iter,
FormFieldData* field_data) { … }
bool DeserializeSection12(base::PickleIterator* iter,
FormFieldData* field_data) { … }
bool DeserializeSection2(base::PickleIterator* iter,
FormFieldData* field_data) { … }
bool DeserializeSection4(base::PickleIterator* iter,
FormFieldData* field_data) { … }
bool DeserializeSection8(base::PickleIterator* iter,
FormFieldData* field_data) { … }
bool DeserializeSection9(base::PickleIterator* iter,
FormFieldData* field_data) { … }
bool DeserializeSection10(base::PickleIterator* iter,
FormFieldData* field_data) { … }
bool DeserializeSection11(base::PickleIterator* iter,
FormFieldData* field_data) { … }
}
Section Section::FromAutocomplete(Section::Autocomplete autocomplete) { … }
Section Section::FromFieldIdentifier(
const FormFieldData& field,
base::flat_map<LocalFrameToken, size_t>& frame_token_ids) { … }
Section::Section() = default;
Section::Section(const Section& section) = default;
Section::~Section() = default;
operator bool()
bool Section::is_from_autocomplete() const { … }
bool Section::is_from_fieldidentifier() const { … }
bool Section::is_default() const { … }
std::string Section::ToString() const { … }
LogBuffer& operator<<(LogBuffer& buffer, const Section& section) { … }
std::ostream& operator<<(std::ostream& os, const Section& section) { … }
LogBuffer& operator<<(LogBuffer& buffer, FormControlType type) { … }
FormFieldData::FormFieldData() = default;
FormFieldData::FormFieldData(const FormFieldData&) = default;
FormFieldData& FormFieldData::operator=(const FormFieldData&) = default;
FormFieldData::FormFieldData(FormFieldData&&) = default;
FormFieldData& FormFieldData::operator=(FormFieldData&&) = default;
FormFieldData::~FormFieldData() = default;
base::optional_ref<const SelectOption> FormFieldData::selected_option() const { … }
bool FormFieldData::SameFieldAs(const FormFieldData& field) const { … }
bool FormFieldData::IsTextInputElement() const { … }
bool FormFieldData::IsPasswordInputElement() const { … }
bool FormFieldData::IsSelectElement() const { … }
bool FormFieldData::IsSelectListElement() const { … }
bool FormFieldData::IsSelectOrSelectListElement() const { … }
bool FormFieldData::DidUserType() const { … }
bool FormFieldData::HadFocus() const { … }
bool FormFieldData::WasPasswordAutofilled() const { … }
bool FormFieldData::DeepEqual(const FormFieldData& a, const FormFieldData& b) { … }
FormFieldData::FillData::FillData() = default;
FormFieldData::FillData::~FillData() = default;
FormFieldData::FillData::FillData(const FormFieldData& field)
: … { … }
FormFieldData::FillData::FillData(const FillData&) = default;
FormFieldData::FillData& FormFieldData::FillData::operator=(const FillData&) =
default;
std::string_view FormControlTypeToString(FormControlType type) { … }
FormControlType StringToFormControlTypeDiscouraged(
std::string_view type_string,
std::optional<FormControlType> fallback) { … }
void SerializeFormFieldData(const FormFieldData& field_data,
base::Pickle* pickle) { … }
bool DeserializeFormFieldData(base::PickleIterator* iter,
FormFieldData* field_data) { … }
std::ostream& operator<<(std::ostream& os, const FormFieldData& field) { … }
LogBuffer& operator<<(LogBuffer& buffer, const FormFieldData& field) { … }
}