#include "chrome/browser/extensions/api/omnibox/suggestion_parser.h"
#include <string_view>
#include "base/functional/callback.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/common/extensions/api/omnibox.h"
#include "components/omnibox/browser/autocomplete_match.h"
#include "services/data_decoder/public/cpp/data_decoder.h"
#include "services/data_decoder/public/cpp/safe_xml_parser.h"
#include "services/data_decoder/public/mojom/xml_parser.mojom.h"
namespace extensions {
omnibox;
namespace {
std::string CheckedGetElementTag(const base::Value& node) { … }
void WalkNode(const base::Value& node, DescriptionAndStyles* result) { … }
bool PopulateEntriesFromNode(const base::Value& root_node,
std::vector<const base::Value*>* entries_out) { … }
void ConstructResultFromValue(
DescriptionAndStylesCallback callback,
bool has_multiple_entries,
data_decoder::DataDecoder::ValueOrError value_or_error) { … }
void ParseDescriptionAndStylesImpl(std::string_view xml_input,
bool contains_multiple_entries,
DescriptionAndStylesCallback callback) { … }
}
DescriptionAndStyles::DescriptionAndStyles() = default;
DescriptionAndStyles::DescriptionAndStyles(DescriptionAndStyles&&) = default;
DescriptionAndStyles& DescriptionAndStyles::operator=(DescriptionAndStyles&&) =
default;
DescriptionAndStyles::~DescriptionAndStyles() = default;
DescriptionAndStylesResult::DescriptionAndStylesResult() = default;
DescriptionAndStylesResult::DescriptionAndStylesResult(
DescriptionAndStylesResult&&) = default;
DescriptionAndStylesResult& DescriptionAndStylesResult::operator=(
DescriptionAndStylesResult&&) = default;
DescriptionAndStylesResult::~DescriptionAndStylesResult() = default;
void ParseDescriptionAndStyles(std::string_view str,
DescriptionAndStylesCallback callback) { … }
void ParseDescriptionsAndStyles(const std::vector<std::string_view>& strs,
DescriptionAndStylesCallback callback) { … }
}