#ifndef COMPONENTS_OPTIMIZATION_GUIDE_CORE_OPTIMIZATION_GUIDE_UTIL_H_
#define COMPONENTS_OPTIMIZATION_GUIDE_CORE_OPTIMIZATION_GUIDE_UTIL_H_
#include <optional>
#include <string>
#include <string_view>
#include "base/strings/string_split.h"
#include "base/time/time.h"
#include "components/optimization_guide/core/model_execution/feature_keys.h"
#include "components/optimization_guide/core/optimization_guide_enums.h"
#include "components/optimization_guide/core/optimization_guide_permissions_util.h"
#include "components/optimization_guide/core/optimization_guide_switches.h"
#include "components/optimization_guide/proto/common_types.pb.h"
#include "components/optimization_guide/proto/model_execution.pb.h"
#include "components/optimization_guide/proto/models.pb.h"
#define OPTIMIZATION_GUIDE_LOG(log_source, optimization_guide_logger, message) …
class OptimizationGuideLogger;
class PrefService;
namespace network {
struct ResourceRequest;
}
namespace optimization_guide {
enum class OptimizationGuideDecision;
std::string_view GetStringNameForModelExecutionFeature(
std::optional<UserVisibleFeatureKey> feature);
std::string_view GetStringNameForModelExecutionFeature(
ModelBasedCapabilityKey feature);
std::string_view GetStringNameForModelExecutionFeature(
proto::ModelExecutionFeature feature);
bool IsHostValidToFetchFromRemoteOptimizationGuide(const std::string& host);
template <class T,
class = typename std::enable_if<
std::is_convertible<T*, google::protobuf::MessageLite*>{ … }
std::string GetStringForOptimizationGuideDecision(
OptimizationGuideDecision decision);
proto::OriginInfo GetClientOriginInfo();
void LogFeatureFlagsInfo(OptimizationGuideLogger* optimization_guide_logger,
bool is_off_the_record,
PrefService* pref_service);
void PopulateAuthorizationRequestHeader(
network::ResourceRequest* resource_request,
std::string_view access_token);
void PopulateApiKeyRequestHeader(network::ResourceRequest* resource_request,
std::string_view api_key);
bool ShouldStartModelValidator();
}
#endif