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

Unified Diff: chrome/browser/chromeos/login/signin/oauth2_login_manager.h

Issue 1102863002: Revert of Fetch OAuth2 tokens prior to profile creation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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/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_;

Powered by Google App Engine
This is Rietveld 408576698