#include "components/gcm_driver/gcm_account_tracker.h"
#include <stdint.h>
#include <algorithm>
#include <vector>
#include "base/functional/bind.h"
#include "base/location.h"
#include "base/task/single_thread_task_runner.h"
#include "base/time/time.h"
#include "components/gcm_driver/gcm_driver.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/identity_manager.h"
#include "components/signin/public/identity_manager/scope_set.h"
#include "google_apis/gaia/gaia_constants.h"
#include "google_apis/gaia/google_service_auth_error.h"
#include "net/base/ip_endpoint.h"
namespace gcm {
namespace {
const char kGCMAccountTrackerName[] = …;
const int64_t kMinimumTokenValidityMs = …;
const int64_t kTokenReportingIntervalMs = …;
}
GCMAccountTracker::AccountInfo::AccountInfo(const std::string& email,
AccountState state)
: … { … }
GCMAccountTracker::AccountInfo::~AccountInfo() { … }
GCMAccountTracker::GCMAccountTracker(
std::unique_ptr<AccountTracker> account_tracker,
signin::IdentityManager* identity_manager,
GCMDriver* driver)
: … { … }
GCMAccountTracker::~GCMAccountTracker() { … }
void GCMAccountTracker::Shutdown() { … }
void GCMAccountTracker::Start() { … }
void GCMAccountTracker::ScheduleReportTokens() { … }
void GCMAccountTracker::OnAccountSignInChanged(const CoreAccountInfo& account,
bool is_signed_in) { … }
void GCMAccountTracker::OnAccessTokenFetchCompleteForAccount(
CoreAccountId account_id,
GoogleServiceAuthError error,
signin::AccessTokenInfo access_token_info) { … }
void GCMAccountTracker::OnConnected(const net::IPEndPoint& ip_endpoint) { … }
void GCMAccountTracker::OnDisconnected() { … }
void GCMAccountTracker::ReportTokens() { … }
void GCMAccountTracker::SanitizeTokens() { … }
bool GCMAccountTracker::IsTokenReportingRequired() const { … }
bool GCMAccountTracker::IsTokenFetchingRequired() const { … }
base::TimeDelta GCMAccountTracker::GetTimeToNextTokenReporting() const { … }
void GCMAccountTracker::GetAllNeededTokens() { … }
void GCMAccountTracker::GetToken(AccountInfos::iterator& account_iter) { … }
void GCMAccountTracker::OnAccountSignedIn(const CoreAccountInfo& account) { … }
void GCMAccountTracker::OnAccountSignedOut(const CoreAccountInfo& account) { … }
}