Index: chrome/browser/chromeos/login/signin/oauth2_login_manager.h |
diff --git a/chrome/browser/chromeos/login/signin/oauth2_login_manager.h b/chrome/browser/chromeos/login/signin/oauth2_login_manager.h |
index a197d8c5ad634da7baff190f5991dabd2a1c54b5..15b3473361a3f51046a84e3a6385d63516abc479 100644 |
--- a/chrome/browser/chromeos/login/signin/oauth2_login_manager.h |
+++ b/chrome/browser/chromeos/login/signin/oauth2_login_manager.h |
@@ -58,6 +58,8 @@ |
RESTORE_FROM_SAVED_OAUTH2_REFRESH_TOKEN, |
// Restore session from OAuth2 refresh token passed via command line. |
RESTORE_FROM_PASSED_OAUTH2_REFRESH_TOKEN, |
+ // Restore session from authentication code passed via command line. |
+ RESTORE_FROM_AUTH_CODE, |
}; |
class Observer { |
@@ -82,20 +84,24 @@ |
void AddObserver(OAuth2LoginManager::Observer* observer); |
void RemoveObserver(OAuth2LoginManager::Observer* observer); |
- // Restores and verifies OAuth tokens following specified |restore_strategy|. |
- // For |restore_strategy| RESTORE_FROM_PASSED_OAUTH2_REFRESH_TOKEN, parameter |
- // |oauth2_refresh_token| needs to have a non-empty value. |
- // For |restore_strategy| RESTORE_FROM_COOKIE_JAR |auth_request_context| must |
- // be initialized. |
- void RestoreSession(net::URLRequestContextGetter* auth_request_context, |
- SessionRestoreStrategy restore_strategy, |
- const std::string& oauth2_refresh_token, |
- const std::string& oauth2_access_token); |
+ // Restores and verifies OAuth tokens either following specified |
+ // |restore_strategy|. For |restore_strategy| with values |
+ // RESTORE_FROM_PASSED_OAUTH2_REFRESH_TOKEN or |
+ // RESTORE_FROM_AUTH_CODE, respectively |
+ // parameters |oauth2_refresh_token| or |auth_code| need to have non-empty |
+ // value. |
+ // For |restore_strategy| with values RESTORE_FROM_COOKIE_JAR or |
+ // RESTORE_FROM_AUTH_CODE |auth_request_context| must be initialized. |
+ void RestoreSession( |
+ net::URLRequestContextGetter* auth_request_context, |
+ SessionRestoreStrategy restore_strategy, |
+ const std::string& oauth2_refresh_token, |
+ const std::string& auth_code); |
// Continues session restore after transient network errors. |
void ContinueSessionRestore(); |
- // Start restoring session from saved OAuth2 refresh token. |
+ // Start resporting session from saved OAuth2 refresh token. |
void RestoreSessionFromSavedTokens(); |
// Stops all background authentication requests. |
@@ -146,7 +152,7 @@ |
// gaia::GaiaOAuthClient::Delegate overrides. |
void OnRefreshTokenResponse(const std::string& access_token, |
- int expires_in_seconds) override; |
+ int expires_in_seconds) override; |
void OnGetUserInfoResponse( |
scoped_ptr<base::DictionaryValue> user_info) override; |
void OnOAuthError() override; |
@@ -244,6 +250,9 @@ |
// OAuthLogin scoped access token. |
std::string oauthlogin_access_token_; |
+ // Authorization code for fetching OAuth2 tokens. |
+ std::string auth_code_; |
+ |
// Session restore start time. |
base::Time session_restore_start_; |