#include "components/sync/service/sync_auth_manager.h"
#include <utility>
#include "base/functional/bind.h"
#include "base/time/time.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/scope_set.h"
#include "components/sync/base/stop_source.h"
#include "components/sync/engine/sync_credentials.h"
#include "google_apis/gaia/gaia_constants.h"
#include "google_apis/gaia/google_service_auth_error.h"
namespace syncer {
namespace {
constexpr char kSyncOAuthConsumerName[] = …;
constexpr net::BackoffEntry::Policy
kIgnoreFirstErrorRequestAccessTokenBackoffPolicy = …;
SyncAccountInfo DetermineAccountToUse(
signin::IdentityManager* identity_manager) { … }
}
SyncAuthManager::SyncAuthManager(
signin::IdentityManager* identity_manager,
const AccountStateChangedCallback& account_state_changed,
const CredentialsChangedCallback& credentials_changed)
: … { … }
SyncAuthManager::~SyncAuthManager() { … }
void SyncAuthManager::RegisterForAuthNotifications() { … }
bool SyncAuthManager::IsActiveAccountInfoFullyLoaded() const { … }
SyncAccountInfo SyncAuthManager::GetActiveAccountInfo() const { … }
GoogleServiceAuthError SyncAuthManager::GetLastAuthError() const { … }
base::Time SyncAuthManager::GetLastAuthErrorTime() const { … }
bool SyncAuthManager::IsSyncPaused() const { … }
SyncTokenStatus SyncAuthManager::GetSyncTokenStatus() const { … }
SyncCredentials SyncAuthManager::GetCredentials() const { … }
void SyncAuthManager::ConnectionOpened() { … }
void SyncAuthManager::ConnectionStatusChanged(ConnectionStatus status) { … }
void SyncAuthManager::InvalidateAccessToken() { … }
void SyncAuthManager::ClearAccessTokenAndRequest() { … }
void SyncAuthManager::ScheduleAccessTokenRequest() { … }
void SyncAuthManager::ConnectionClosed() { … }
void SyncAuthManager::OnPrimaryAccountChanged(
const signin::PrimaryAccountChangeEvent& event) { … }
void SyncAuthManager::OnRefreshTokenUpdatedForAccount(
const CoreAccountInfo& account_info) { … }
void SyncAuthManager::OnRefreshTokenRemovedForAccount(
const CoreAccountId& account_id) { … }
void SyncAuthManager::OnErrorStateOfRefreshTokenUpdatedForAccount(
const CoreAccountInfo& account_info,
const GoogleServiceAuthError& error,
signin_metrics::SourceForRefreshTokenOperation token_operation_source) { … }
void SyncAuthManager::OnRefreshTokensLoaded() { … }
bool SyncAuthManager::IsRetryingAccessTokenFetchForTest() const { … }
void SyncAuthManager::ResetRequestAccessTokenBackoffForTest() { … }
SyncAccountInfo SyncAuthManager::DetermineAccountToUse() const { … }
bool SyncAuthManager::UpdateSyncAccountIfNecessary() { … }
void SyncAuthManager::RequestAccessToken() { … }
void SyncAuthManager::AccessTokenFetched(
GoogleServiceAuthError error,
signin::AccessTokenInfo access_token_info) { … }
void SyncAuthManager::SetLastAuthError(const GoogleServiceAuthError& error) { … }
}