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

Unified Diff: google_apis/gaia/fake_gaia.cc

Issue 134483008: Switch GAIA e-mail address retrieval from /GetUserInfo to /ListAccounts (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
« no previous file with comments | « google_apis/gaia/fake_gaia.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: google_apis/gaia/fake_gaia.cc
diff --git a/google_apis/gaia/fake_gaia.cc b/google_apis/gaia/fake_gaia.cc
index 5ddd8f0f9bcef1b83cdc05d4ab75a8f639c85151..3eec9a879e0f6c9f80946fcb98b14c63f4ecb20e 100644
--- a/google_apis/gaia/fake_gaia.cc
+++ b/google_apis/gaia/fake_gaia.cc
@@ -47,6 +47,9 @@ const base::FilePath::CharType kServiceLogin[] =
const char kAuthHeaderBearer[] = "Bearer ";
const char kAuthHeaderOAuth[] = "OAuth ";
+const char kListAccountsResponseFormat[] =
+ "[\"gaia.l.a.r\",[[\"gaia.l.a\",1,\"\",\"%s\",\"\",1,1,0]]]";
+
typedef std::map<std::string, std::string> CookieMap;
// Parses cookie name-value map our of |request|.
@@ -169,9 +172,9 @@ void FakeGaia::Initialize() {
REGISTER_RESPONSE_HANDLER(
gaia_urls->oauth2_issue_token_url(), HandleIssueToken);
- // Handles /GetUserInfo GAIA call.
+ // Handles /ListAccounts GAIA call.
REGISTER_RESPONSE_HANDLER(
- gaia_urls->get_user_info_url(), HandleGetUserInfo);
+ gaia_urls->list_accounts_url(), HandleListAccounts);
}
scoped_ptr<HttpResponse> FakeGaia::HandleRequest(const HttpRequest& request) {
@@ -519,20 +522,9 @@ void FakeGaia::HandleIssueToken(const HttpRequest& request,
}
}
-void FakeGaia::HandleGetUserInfo(const HttpRequest& request,
+void FakeGaia::HandleListAccounts(const HttpRequest& request,
BasicHttpResponse* http_response) {
- std::string lsid;
- if (!GetQueryParameter(request.content, "LSID", &lsid)) {
- http_response->set_code(net::HTTP_BAD_REQUEST);
- LOG(ERROR) << "/GetUserInfo missing LSID";
- return;
- }
- if (lsid != merge_session_params_.auth_lsid_cookie) {
- http_response->set_code(net::HTTP_BAD_REQUEST);
- LOG(ERROR) << "/GetUserInfo contains unknown LSID";
- return;
- }
http_response->set_content(base::StringPrintf(
- "email=%s", merge_session_params_.email.c_str()));
+ kListAccountsResponseFormat, merge_session_params_.email.c_str()));
http_response->set_code(net::HTTP_OK);
}
« no previous file with comments | « google_apis/gaia/fake_gaia.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698