Index: chrome/common/net/gaia/gaia_auth_fetcher.h |
=================================================================== |
--- chrome/common/net/gaia/gaia_auth_fetcher.h (revision 95804) |
+++ chrome/common/net/gaia/gaia_auth_fetcher.h (working copy) |
@@ -71,6 +71,11 @@ |
// Start a TokenAuth request to pre-login the user with the given credentials. |
void StartTokenAuth(const std::string& auth_token); |
+ // Start a MergeSession request to pre-login the user with the given |
+ // credentials. Unlike TokenAuth above, MergeSession will not sign out any |
+ // existing accounts. |
+ void StartMergeSession(const std::string& auth_token); |
+ |
// Implementation of URLFetcher::Delegate |
virtual void OnURLFetchComplete(const URLFetcher* source, |
const GURL& url, |
@@ -108,6 +113,8 @@ |
static const char kGetUserInfoFormat[]; |
// The format of the POST body for TokenAuth. |
static const char kTokenAuthFormat[]; |
+ // The format of the POST body for MergeSession. |
+ static const char kMergeSessionFormat[]; |
// Constants for parsing ClientLogin errors. |
static const char kAccountDeletedError[]; |
@@ -142,6 +149,10 @@ |
const net::URLRequestStatus& status, |
int response_code); |
+ void OnMergeSessionFetched(const std::string& data, |
+ const net::URLRequestStatus& status, |
+ int response_code); |
+ |
// Tokenize the results of a ClientLogin fetch. |
static void ParseClientLoginResponse(const std::string& data, |
std::string* sid, |
@@ -180,7 +191,21 @@ |
const std::string& continue_url, |
const std::string& source); |
+ // Supply the authentication token returned from StartIssueAuthToken. |
+ static std::string MakeMergeSessionBody(const std::string& auth_token, |
+ const std::string& continue_url, |
+ const std::string& source); |
+ |
// Create a fetcher useable for making any Gaia request. |
+ static URLFetcher* CreateGaiaFetcherWithFlags( |
Rick Campbell
2011/08/08 21:24:51
In the context of authentication code, I prefer a
Roger Tawa OOO till Jul 10th
2011/08/09 20:50:49
Done.
|
+ net::URLRequestContextGetter* getter, |
+ const std::string& body, |
+ const GURL& gaia_gurl, |
+ int flags, |
+ URLFetcher::Delegate* delegate); |
+ |
+ // Create a fetcher useable for making any Gaia request. The flags |
+ // net::LOAD_DO_NOT_SEND_COOKIES are used when creating the fetcher. |
static URLFetcher* CreateGaiaFetcher(net::URLRequestContextGetter* getter, |
const std::string& body, |
const GURL& gaia_gurl_, |
@@ -201,6 +226,7 @@ |
const GURL issue_auth_token_gurl_; |
const GURL get_user_info_gurl_; |
const GURL token_auth_gurl_; |
+ const GURL merge_session_gurl_; |
// While a fetch is going on: |
scoped_ptr<URLFetcher> fetcher_; |