#include "components/invalidation/impl/profile_identity_provider.h"
#include "base/functional/bind.h"
#include "components/signin/public/base/consent_level.h"
#include "components/signin/public/identity_manager/access_token_info.h"
#include "components/signin/public/identity_manager/account_info.h"
#include "components/signin/public/identity_manager/primary_account_access_token_fetcher.h"
namespace invalidation {
namespace {
class AccessTokenFetcherAdaptor : public ActiveAccountAccessTokenFetcher { … };
AccessTokenFetcherAdaptor::AccessTokenFetcherAdaptor(
const std::string& oauth_consumer_name,
signin::IdentityManager* identity_manager,
const signin::ScopeSet& scopes,
ActiveAccountAccessTokenCallback callback)
: … { … }
void AccessTokenFetcherAdaptor::HandleTokenRequestCompletion(
GoogleServiceAuthError error,
signin::AccessTokenInfo access_token_info) { … }
}
ProfileIdentityProvider::ProfileIdentityProvider(
signin::IdentityManager* identity_manager)
: … { … }
ProfileIdentityProvider::~ProfileIdentityProvider() { … }
CoreAccountId ProfileIdentityProvider::GetActiveAccountId() { … }
bool ProfileIdentityProvider::IsActiveAccountWithRefreshToken() { … }
std::unique_ptr<ActiveAccountAccessTokenFetcher>
ProfileIdentityProvider::FetchAccessToken(
const std::string& oauth_consumer_name,
const signin::ScopeSet& scopes,
ActiveAccountAccessTokenCallback callback) { … }
void ProfileIdentityProvider::InvalidateAccessToken(
const signin::ScopeSet& scopes,
const std::string& access_token) { … }
void ProfileIdentityProvider::OnPrimaryAccountChanged(
const signin::PrimaryAccountChangeEvent& event_details) { … }
void ProfileIdentityProvider::OnRefreshTokenUpdatedForAccount(
const CoreAccountInfo& account_info) { … }
}