#include "components/policy/core/common/cloud/user_info_fetcher.h"
#include "base/functional/bind.h"
#include "base/json/json_reader.h"
#include "base/metrics/histogram_functions.h"
#include "base/strings/stringprintf.h"
#include "base/values.h"
#include "components/policy/core/common/policy_logger.h"
#include "google_apis/gaia/gaia_urls.h"
#include "google_apis/gaia/google_service_auth_error.h"
#include "net/base/load_flags.h"
#include "net/http/http_status_code.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
#include "services/network/public/cpp/resource_request.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
#include "services/network/public/cpp/simple_url_loader.h"
#include "services/network/public/mojom/url_response_head.mojom.h"
#include "url/gurl.h"
namespace {
static const char kAuthorizationHeaderFormat[] = …;
static std::string MakeAuthorizationHeader(const std::string& auth_token) { … }
static const char kLegacyGoogleApisHost[] = …;
GURL SwitchBackToLegacyHostIfNeeded(GURL url) { … }
void RecordFetchStatus(policy::EnterpriseUserInfoFetchStatus status) { … }
void RecordHttpErrorCode(int code) { … }
}
namespace policy {
UserInfoFetcher::UserInfoFetcher(
Delegate* delegate,
scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory)
: … { … }
UserInfoFetcher::~UserInfoFetcher() { … }
void UserInfoFetcher::Start(const std::string& access_token) { … }
void UserInfoFetcher::OnFetchComplete(
std::unique_ptr<std::string> unparsed_data) { … }
}