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

Unified Diff: google_apis/gaia/gaia_oauth_client.h

Issue 17109006: Device robot refresh token integrity validation. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fix remoting compile error on windows Created 7 years, 6 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 | « chrome/service/cloud_print/cloud_print_auth.cc ('k') | google_apis/gaia/gaia_oauth_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: google_apis/gaia/gaia_oauth_client.h
diff --git a/google_apis/gaia/gaia_oauth_client.h b/google_apis/gaia/gaia_oauth_client.h
index 17d6dbd05beb52257bd609443b3c9b3ac1accabe..a8af6588a7462b272cd1f83ac31f732292b6df84 100644
--- a/google_apis/gaia/gaia_oauth_client.h
+++ b/google_apis/gaia/gaia_oauth_client.h
@@ -6,15 +6,21 @@
#define GOOGLE_APIS_GAIA_GAIA_OAUTH_CLIENT_H_
#include <string>
+#include <vector>
#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop_proxy.h"
+#include "base/values.h"
namespace net {
class URLRequestContextGetter;
}
// A helper class to get and refresh OAuth tokens given an authorization code.
+// Also exposes utility methods for fetching user email and token owner.
+// Supports one request at a time; for parallel requests, create multiple
+// instances.
namespace gaia {
struct OAuthClientInfo {
@@ -25,17 +31,22 @@ struct OAuthClientInfo {
class GaiaOAuthClient {
public:
+ const static int kUrlFetcherId;
+
class Delegate {
public:
// Invoked on a successful response to the GetTokensFromAuthCode request.
virtual void OnGetTokensResponse(const std::string& refresh_token,
const std::string& access_token,
- int expires_in_seconds) = 0;
+ int expires_in_seconds) {}
// Invoked on a successful response to the RefreshToken request.
virtual void OnRefreshTokenResponse(const std::string& access_token,
- int expires_in_seconds) = 0;
+ int expires_in_seconds) {}
// Invoked on a successful response to the GetUserInfo request.
- virtual void OnGetUserInfoResponse(const std::string& user_email) {};
+ virtual void OnGetUserInfoResponse(const std::string& user_email) {}
+ // Invoked on a successful response to the GetTokenInfo request.
+ virtual void OnGetTokenInfoResponse(
+ scoped_ptr<DictionaryValue> token_info) {}
// Invoked when there is an OAuth error with one of the requests.
virtual void OnOAuthError() = 0;
// Invoked when there is a network error or upon receiving an invalid
@@ -46,8 +57,8 @@ class GaiaOAuthClient {
protected:
virtual ~Delegate() {}
};
- GaiaOAuthClient(const std::string& gaia_url,
- net::URLRequestContextGetter* context_getter);
+
+ GaiaOAuthClient(net::URLRequestContextGetter* context_getter);
~GaiaOAuthClient();
// In the below methods, |max_retries| specifies the maximum number of times
@@ -60,11 +71,15 @@ class GaiaOAuthClient {
Delegate* delegate);
void RefreshToken(const OAuthClientInfo& oauth_client_info,
const std::string& refresh_token,
+ const std::vector<std::string>& scopes,
int max_retries,
Delegate* delegate);
void GetUserInfo(const std::string& oauth_access_token,
int max_retries,
Delegate* delegate);
+ void GetTokenInfo(const std::string& oauth_access_token,
+ int max_retries,
+ Delegate* delegate);
private:
// The guts of the implementation live in this class.
« no previous file with comments | « chrome/service/cloud_print/cloud_print_auth.cc ('k') | google_apis/gaia/gaia_oauth_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698