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

Unified Diff: chrome/browser/ui/webui/chromeos/login/authenticated_user_email_retriever.h

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 | « no previous file | chrome/browser/ui/webui/chromeos/login/authenticated_user_email_retriever.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/chromeos/login/authenticated_user_email_retriever.h
diff --git a/chrome/browser/ui/webui/chromeos/login/authenticated_user_email_retriever.h b/chrome/browser/ui/webui/chromeos/login/authenticated_user_email_retriever.h
index 03bd29efba6579c79a46c1ac83ee7c3c78975d00..91d0952562b832dd39d913c76f6e816f0cbdabb8 100644
--- a/chrome/browser/ui/webui/chromeos/login/authenticated_user_email_retriever.h
+++ b/chrome/browser/ui/webui/chromeos/login/authenticated_user_email_retriever.h
@@ -8,17 +8,18 @@
#include <string>
#include "base/basictypes.h"
-#include "base/callback_forward.h"
+#include "base/callback.h"
#include "base/compiler_specific.h"
#include "base/memory/ref_counted.h"
-#include "base/memory/weak_ptr.h"
#include "google_apis/gaia/gaia_auth_consumer.h"
-#include "net/cookies/canonical_cookie.h"
-#include "net/cookies/cookie_store.h"
-#include "net/url_request/url_request_context_getter.h"
+#include "google_apis/gaia/gaia_auth_fetcher.h"
class GaiaAuthFetcher;
+namespace net {
+class URLRequestContextGetter;
+}
+
namespace chromeos {
// Helper class that retrieves the authenticated user's e-mail address.
@@ -27,30 +28,23 @@ class AuthenticatedUserEmailRetriever : public GaiaAuthConsumer {
typedef base::Callback<void(const std::string&)>
AuthenticatedUserEmailCallback;
- // Extracts the GAIA cookies from |url_request_context_getter|, retrieves the
- // authenticated user's e-mail address from GAIA and passes it to |callback|.
- // If the e-mail address cannot be retrieved, an empty string is passed to
- // the |callback|.
+ // Retrieves the authenticated user's e-mail address from GAIA and passes it
+ // to |callback|. Requires that |url_request_context_getter| contain the GAIA
+ // cookies for exactly one user. If the e-mail address cannot be retrieved, an
+ // empty string is passed to the |callback|.
AuthenticatedUserEmailRetriever(
const AuthenticatedUserEmailCallback& callback,
scoped_refptr<net::URLRequestContextGetter> url_request_context_getter);
virtual ~AuthenticatedUserEmailRetriever();
// GaiaAuthConsumer:
- virtual void OnGetUserInfoSuccess(const UserInfoMap& data) OVERRIDE;
- virtual void OnGetUserInfoFailure(
- const GoogleServiceAuthError& error) OVERRIDE;
+ virtual void OnListAccountsSuccess(const std::string& data) OVERRIDE;
+ virtual void OnListAccountsFailure(const GoogleServiceAuthError& error)
+ OVERRIDE;
private:
- void ExtractCookies(scoped_refptr<net::CookieStore> cookie_store);
- void ExtractLSIDFromCookies(const net::CookieList& cookies);
-
- AuthenticatedUserEmailCallback callback_;
-
- scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_;
- scoped_ptr<GaiaAuthFetcher> gaia_auth_fetcher_;
-
- base::WeakPtrFactory<AuthenticatedUserEmailRetriever> weak_factory_;
+ const AuthenticatedUserEmailCallback callback_;
+ GaiaAuthFetcher gaia_auth_fetcher_;
DISALLOW_COPY_AND_ASSIGN(AuthenticatedUserEmailRetriever);
};
« no previous file with comments | « no previous file | chrome/browser/ui/webui/chromeos/login/authenticated_user_email_retriever.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698