#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "components/search_engines/template_url_data_util.h"
#include <string>
#include <string_view>
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "components/search_engines/default_search_manager.h"
#include "components/search_engines/prepopulated_engines.h"
#include "components/search_engines/template_url_data.h"
#include "components/search_engines/template_url_starter_pack_data.h"
#include "ui/base/l10n/l10n_util.h"
#include "url/gurl.h"
namespace {
std::string_view ToStringPiece(const char* str) { … }
std::u16string_view ToU16StringView(const char16_t* str) { … }
}
std::unique_ptr<TemplateURLData> TemplateURLDataFromDictionary(
const base::Value::Dict& dict) { … }
base::Value::Dict TemplateURLDataToDictionary(const TemplateURLData& data) { … }
std::unique_ptr<TemplateURLData> TemplateURLDataFromPrepopulatedEngine(
const TemplateURLPrepopulateData::PrepopulatedEngine& engine) { … }
std::unique_ptr<TemplateURLData> TemplateURLDataFromOverrideDictionary(
const base::Value::Dict& engine_dict) { … }
std::unique_ptr<TemplateURLData> TemplateURLDataFromStarterPackEngine(
const TemplateURLStarterPackData::StarterPackEngine& engine) { … }