#include "remoting/host/setup/host_starter_oauth_helper.h"
#include <memory>
#include <string>
#include <utility>
#include "base/functional/callback.h"
#include "base/memory/scoped_refptr.h"
#include "base/memory/weak_ptr.h"
#include "base/strings/stringprintf.h"
#include "google_apis/gaia/gaia_oauth_client.h"
#include "remoting/host/setup/host_starter.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
namespace remoting {
namespace {
Result;
constexpr int kMaxGetTokensRetries = …;
}
HostStarterOAuthHelper::HostStarterOAuthHelper(
scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory)
: … { … }
HostStarterOAuthHelper::~HostStarterOAuthHelper() = default;
void HostStarterOAuthHelper::FetchTokens(
const std::string& user_email,
const std::string& authorization_code,
gaia::OAuthClientInfo oauth_client_info,
OnDoneCallback done_callback,
OnErrorCallback error_callback) { … }
void HostStarterOAuthHelper::OnGetTokensResponse(
const std::string& refresh_token,
const std::string& access_token,
int expires_in_seconds) { … }
void HostStarterOAuthHelper::OnRefreshTokenResponse(
const std::string& access_token,
int expires_in_seconds) { … }
void HostStarterOAuthHelper::OnGetUserEmailResponse(
const std::string& user_email) { … }
void HostStarterOAuthHelper::OnOAuthError() { … }
void HostStarterOAuthHelper::OnNetworkError(int response_code) { … }
}