#include "components/optimization_guide/core/access_token_helper.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/metrics/histogram_functions.h"
#include "components/optimization_guide/core/optimization_guide_enums.h"
#include "components/signin/public/identity_manager/access_token_fetcher.h"
#include "components/signin/public/identity_manager/access_token_info.h"
#include "components/signin/public/identity_manager/primary_account_access_token_fetcher.h"
#include "google_apis/gaia/gaia_constants.h"
#include "google_apis/gaia/google_service_auth_error.h"
namespace optimization_guide {
namespace {
constexpr char kOptGuideOAuthConsumerName[] = …;
void RecordAccessTokenResultHistogram(
OptimizationGuideAccessTokenResult result) { … }
void OnAccessTokenRequestCompleted(
std::unique_ptr<signin::PrimaryAccountAccessTokenFetcher>,
AccessTokenReceivedCallback callback,
GoogleServiceAuthError error,
signin::AccessTokenInfo access_token_info) { … }
}
void RequestAccessToken(signin::IdentityManager* identity_manager,
const std::set<std::string>& oauth_scopes,
AccessTokenReceivedCallback callback) { … }
}