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

Unified Diff: remoting/host/gaia_user_email_fetcher.h

Issue 11049006: [Chromoting] Add a helper class to map an OAuth access token to an email address. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove an unused method. Created 8 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 | « no previous file | remoting/host/gaia_user_email_fetcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/gaia_user_email_fetcher.h
diff --git a/remoting/host/gaia_user_email_fetcher.h b/remoting/host/gaia_user_email_fetcher.h
new file mode 100644
index 0000000000000000000000000000000000000000..8f7d34d940b97dd5e121bc3fb3b59af81b074463
--- /dev/null
+++ b/remoting/host/gaia_user_email_fetcher.h
@@ -0,0 +1,49 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef REMOTING_HOST_GAIA_USER_EMAIL_FETCHER_H_
+#define REMOTING_HOST_GAIA_USER_EMAIL_FETCHER_H_
+
+#include <string>
+
+#include "base/memory/ref_counted.h"
+#include "base/message_loop_proxy.h"
+
+namespace net {
+class URLRequestContextGetter;
+} // namespace net
+
+// A helper class to get a user's email, given an OAuth access token.
+// TODO(simonmorris): Consider moving this to google_apis/gaia.
+namespace remoting {
+
+class GaiaUserEmailFetcher {
+ public:
+ class Delegate {
+ public:
+ virtual ~Delegate() { }
+
+ // Invoked on a successful response to the GetUserEmail request.
+ virtual void OnGetUserEmailResponse(const std::string& user_email) = 0;
+ // Invoked when there is a network error or upon receiving an
+ // invalid response.
+ virtual void OnNetworkError(int response_code) = 0;
+ };
+
+ GaiaUserEmailFetcher(net::URLRequestContextGetter* context_getter);
+ ~GaiaUserEmailFetcher();
+
+ void GetUserEmail(const std::string& oauth_access_token,
+ Delegate* delegate);
+
+ private:
+ // The guts of the implementation live in this class.
+ class Core;
+ scoped_refptr<Core> core_;
+ DISALLOW_COPY_AND_ASSIGN(GaiaUserEmailFetcher);
+};
+
+} // namespace remoting
+
+#endif // REMOTING_HOST_GAIA_USER_EMAIL_FETCHER_H_
« no previous file with comments | « no previous file | remoting/host/gaia_user_email_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698