#include "components/autofill/core/browser/geo/alternative_state_name_map_updater.h"
#include <memory>
#include <string>
#include <vector>
#include "base/containers/contains.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/logging.h"
#include "base/ranges/algorithm.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/task_traits.h"
#include "base/task/thread_pool.h"
#include "components/autofill/core/browser/address_data_manager.h"
#include "components/autofill/core/browser/geo/country_data.h"
#include "components/autofill/core/common/autofill_features.h"
#include "components/autofill/core/common/autofill_l10n_util.h"
#include "components/autofill/core/common/autofill_prefs.h"
#include "components/prefs/pref_service.h"
namespace autofill {
namespace {
std::string LoadDataFromFile(const base::FilePath& file) { … }
}
AlternativeStateNameMapUpdater::AlternativeStateNameMapUpdater(
PrefService* local_state,
AddressDataManager* address_data_manager)
: … { … }
AlternativeStateNameMapUpdater::~AlternativeStateNameMapUpdater() = default;
bool AlternativeStateNameMapUpdater::ContainsState(
const std::vector<AlternativeStateNameMap::StateName>&
stripped_alternative_state_names,
const AlternativeStateNameMap::StateName&
stripped_state_value_from_profile) { … }
void AlternativeStateNameMapUpdater::OnAddressDataChanged() { … }
void AlternativeStateNameMapUpdater::PopulateAlternativeStateNameMap(
base::OnceClosure callback) { … }
void AlternativeStateNameMapUpdater::LoadStatesData(
CountryToStateNamesListMapping country_to_state_names_map,
PrefService* pref_service,
base::OnceClosure done_callback) { … }
void AlternativeStateNameMapUpdater::ProcessLoadedStateFileContent(
const std::vector<AlternativeStateNameMap::StateName>&
stripped_state_values_from_profiles,
const std::string& data) { … }
std::vector<AlternativeStateNameMap::StateName>
AlternativeStateNameMapUpdater::ExtractAllStateNames(
const StateEntry& state_entry) { … }
scoped_refptr<base::SequencedTaskRunner>&
AlternativeStateNameMapUpdater::GetTaskRunner() { … }
}