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

Unified Diff: chrome/browser/signin/token_service.cc

Issue 11649055: OAuth2 sign-in flow for ChromeOS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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
Index: chrome/browser/signin/token_service.cc
diff --git a/chrome/browser/signin/token_service.cc b/chrome/browser/signin/token_service.cc
index 0e6e601ff77ca2c8deb261b8d443c966cd6763f7..1ffd2a919c0e8c1f701f01717f752ec8f254b45b 100644
--- a/chrome/browser/signin/token_service.cc
+++ b/chrome/browser/signin/token_service.cc
@@ -162,10 +162,8 @@ void TokenService::UpdateCredentials(
}
void TokenService::UpdateCredentialsWithOAuth2(
- const GaiaAuthConsumer::ClientOAuthResult& credentials) {
- // Will be implemented once the ClientOAuth signin is complete. Not called
- // yet by any code.
- NOTREACHED();
+ const GaiaAuthConsumer::ClientOAuthResult& oauth2_tokens) {
+ SaveOAuth2Credentials(oauth2_tokens);
}
void TokenService::LoadTokensFromDB() {
@@ -343,6 +341,10 @@ void TokenService::OnIssueAuthTokenFailure(const std::string& service,
void TokenService::OnClientOAuthSuccess(const ClientOAuthResult& result) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
VLOG(1) << "Got OAuth2 login token pair";
+ SaveOAuth2Credentials(result);
+}
+
+void TokenService::SaveOAuth2Credentials(const ClientOAuthResult& result) {
token_map_[GaiaConstants::kGaiaOAuth2LoginRefreshToken] =
result.refresh_token;
token_map_[GaiaConstants::kGaiaOAuth2LoginAccessToken] = result.access_token;

Powered by Google App Engine
This is Rietveld 408576698