Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(524)

Unified Diff: components/signin/core/browser/gaia_cookie_manager_service.cc

Issue 1129463004: Let Ubertoken Fetch be primed with an access token. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: split access token methods into new methods. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/signin/core/browser/gaia_cookie_manager_service.h ('k') | google_apis/gaia/ubertoken_fetcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « components/signin/core/browser/gaia_cookie_manager_service.h ('k') | google_apis/gaia/ubertoken_fetcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698