#ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_AUTHENTICATED_USER_EMAIL_RETRIEVER_H_
#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_AUTHENTICATED_USER_EMAIL_RETRIEVER_H_
#include <string>
#include "base/basictypes.h"
#include "base/callback.h"
#include "base/compiler_specific.h"
#include "base/memory/ref_counted.h"
#include "google_apis/gaia/gaia_auth_consumer.h"
#include "google_apis/gaia/gaia_auth_fetcher.h"
class GaiaAuthFetcher;
namespace net {
class URLRequestContextGetter;
}
namespace chromeos {
class AuthenticatedUserEmailRetriever : public GaiaAuthConsumer {
public:
typedef base::Callback<void(const std::string&)>
AuthenticatedUserEmailCallback;
AuthenticatedUserEmailRetriever(
const AuthenticatedUserEmailCallback& callback,
scoped_refptr<net::URLRequestContextGetter> url_request_context_getter);
virtual ~AuthenticatedUserEmailRetriever();
virtual void OnListAccountsSuccess(const std::string& data) OVERRIDE;
virtual void OnListAccountsFailure(const GoogleServiceAuthError& error)
OVERRIDE;
private:
const AuthenticatedUserEmailCallback callback_;
GaiaAuthFetcher gaia_auth_fetcher_;
DISALLOW_COPY_AND_ASSIGN(AuthenticatedUserEmailRetriever);
};
}
#endif