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

Unified Diff: google_apis/gaia/fake_gaia.h

Issue 677703002: Revert of Revert of Inline sign in extracts gaia id from HTTP header and seeds account tracker (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 2 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/account_tracker_service_unittest.cc ('k') | google_apis/gaia/fake_gaia.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: google_apis/gaia/fake_gaia.h
diff --git a/google_apis/gaia/fake_gaia.h b/google_apis/gaia/fake_gaia.h
index 4db3b842e1ae7ad6ad17b947283822bd4cdbd5ff..e00a80a7f4d82a22ef16085cc9d54f21cbfab14b 100644
--- a/google_apis/gaia/fake_gaia.h
+++ b/google_apis/gaia/fake_gaia.h
@@ -86,6 +86,11 @@
// Sets the initial value of tokens and cookies.
void SetMergeSessionParams(const MergeSessionParams& params);
+ // Sets the specified |gaia_id| as corresponding to the given |email|
+ // address when setting GAIA response headers. If no mapping is given for
+ // an email address, a default GAIA Id is used.
+ void MapEmailToGaiaId(const std::string& email, const std::string& gaia_id);
+
// Initializes HTTP request handlers. Should be called after switches
// for tweaking GaiaUrls are in place.
void Initialize();
@@ -121,7 +126,14 @@
private:
typedef std::multimap<std::string, AccessTokenInfo> AccessTokenInfoMap;
+ typedef std::map<std::string, std::string> EmailToGaiaIdMap;
typedef std::map<std::string, GURL> SamlAccountIdpMap;
+
+ std::string GetGaiaIdOfEmail(const std::string& email) const;
+
+ void AddGoogleAccountsSigninHeader(
+ net::test_server::BasicHttpResponse* http_response,
+ const std::string& email) const;
// Formats a JSON response with the data in |response_dict|.
void FormatJSONResponse(const base::DictionaryValue& response_dict,
@@ -169,6 +181,7 @@
const;
MergeSessionParams merge_session_params_;
+ EmailToGaiaIdMap email_to_gaia_id_map_;
AccessTokenInfoMap access_token_info_map_;
RequestHandlerMap request_handlers_;
std::string service_login_response_;
« no previous file with comments | « components/signin/core/browser/account_tracker_service_unittest.cc ('k') | google_apis/gaia/fake_gaia.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698