Chromium Code Reviews| Index: components/signin/core/browser/gaia_cookie_manager_service.cc |
| diff --git a/components/signin/core/browser/gaia_cookie_manager_service.cc b/components/signin/core/browser/gaia_cookie_manager_service.cc |
| index e8a0cb76802947ef5702a025e003df2f7c585d55..2796231339df63db355566c00b7f14cad3b29277 100644 |
| --- a/components/signin/core/browser/gaia_cookie_manager_service.cc |
| +++ b/components/signin/core/browser/gaia_cookie_manager_service.cc |
| @@ -322,6 +322,22 @@ void GaiaCookieManagerService::AddAccountToCookie( |
| StartFetchingUbertoken(); |
| } |
| +void GaiaCookieManagerService::AddAccountToCookieWithToken( |
| + const std::string& account_id, const std::string& access_token) { |
|
Roger Tawa OOO till Jul 10th
2015/05/14 20:51:35
nit: two lines?
Mike Lerman
2015/05/15 20:49:47
Done.
|
| + if (!signin_client_->AreSigninCookiesAllowed()) { |
| + SignalComplete(account_id, |
| + GoogleServiceAuthError(GoogleServiceAuthError::REQUEST_CANCELED)); |
| + return; |
| + } |
| + |
| + DCHECK(!account_id.empty()); |
| + DCHECK(!access_token.empty()); |
| + VLOG(1) << "GaiaCookieManagerService::AddAccountToCookie: " << account_id; |
|
Roger Tawa OOO till Jul 10th
2015/05/14 20:51:35
nit: wrong vlog function name.
Mike Lerman
2015/05/15 20:49:47
Done.
|
| + requests_.push_back(GaiaCookieRequest::CreateAddAccountRequest(account_id)); |
| + if (requests_.size() == 1) |
| + StartFetchingUbertokenWithAccessToken(access_token); |
| +} |
| + |
| bool GaiaCookieManagerService::ListAccounts( |
| std::vector<std::pair<std::string,bool> >* accounts) { |
| DCHECK(accounts); |
| @@ -575,6 +591,18 @@ void GaiaCookieManagerService::StartFetchingUbertoken() { |
| uber_token_fetcher_->StartFetchingToken(requests_.front().account_id()); |
| } |
| +void GaiaCookieManagerService::StartFetchingUbertokenWithAccessToken( |
| + const std::string& access_token) { |
| + VLOG(1) << "GaiaCookieManagerService::StartFetching account_id=" |
| + << requests_.front().account_id(); |
|
Roger Tawa OOO till Jul 10th
2015/05/14 20:51:35
nit: wrong vlog function name.
Mike Lerman
2015/05/15 20:49:47
Done.
|
| + DCHECK(!access_token.empty()); |
| + uber_token_fetcher_.reset( |
| + new UbertokenFetcher(token_service_, this, source_, |
| + signin_client_->GetURLRequestContext())); |
| + uber_token_fetcher_->StartFetchingTokenWithAccessToken( |
| + requests_.front().account_id(), access_token); |
| +} |
| + |
| void GaiaCookieManagerService::StartFetchingMergeSession() { |
| DCHECK(!uber_token_.empty()); |
| gaia_auth_fetcher_.reset( |