#include "chrome/browser/devtools/aida_client.h"
#include <string>
#include "base/check_is_test.h"
#include "base/containers/fixed_flat_set.h"
#include "base/json/json_string_value_serializer.h"
#include "base/json/string_escape.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "base/metrics/user_metrics.h"
#include "base/no_destructor.h"
#include "base/strings/string_util.h"
#include "chrome/browser/browser_features.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/signin/identity_manager_factory.h"
#include "chrome/common/pref_names.h"
#include "components/prefs/scoped_user_pref_update.h"
#include "components/signin/public/identity_manager/identity_manager.h"
#include "components/variations/service/variations_service.h"
#include "components/variations/service/variations_service_utils.h"
#include "net/base/load_flags.h"
const char kAidaEndpointUrl[] = …;
const char kAidaScopeUrl[] = …;
constexpr auto kLoggingDisallowedCountries = …;
constexpr auto kAidaSupportedCountries = …;
AidaClient::AidaClient(Profile* profile)
: … { … }
AidaClient::~AidaClient() = default;
std::optional<AccountInfo> AccountInfoForProfile(Profile* profile) { … }
bool IsAidaBlockedByAge(std::optional<AccountInfo> account_info) { … }
std::unique_ptr<std::string>& GetCountryCodeOverride() { … }
std::string GetCountryCode() { … }
bool IsLoggingDisabledByGeo(std::string country_code) { … }
bool IsAidaBlockedByGeo(std::string country_code) { … }
AidaClient::Availability AidaClient::CanUseAida(Profile* profile) { … }
AidaClient::ScopedOverride AidaClient::OverrideCountryForTesting(
std::string country_code) { … }
void AidaClient::OverrideAidaEndpointAndScopeForTesting(
const std::string& aida_endpoint,
const std::string& aida_scope) { … }
void AidaClient::PrepareRequestOrFail(
base::OnceCallback<
void(absl::variant<network::ResourceRequest, std::string>)> callback) { … }
void AidaClient::AccessTokenFetchFinished(
base::OnceCallback<
void(absl::variant<network::ResourceRequest, std::string>)> callback,
GoogleServiceAuthError error,
signin::AccessTokenInfo access_token_info) { … }
void AidaClient::PrepareAidaRequest(
base::OnceCallback<
void(absl::variant<network::ResourceRequest, std::string>)> callback) { … }