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

Unified Diff: remoting/host/setup/oauth_client.h

Issue 1076093003: Added method to host daemon to exchange an auth code for just an OAuth (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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
Index: remoting/host/setup/oauth_client.h
diff --git a/remoting/host/setup/oauth_client.h b/remoting/host/setup/oauth_client.h
index 5cc8f1f3bcfe099ac1e6cacb25db9dd7adbd7cba..5ee22ba9b40c52e9639f17e4e2d465b46575a444 100644
--- a/remoting/host/setup/oauth_client.h
+++ b/remoting/host/setup/oauth_client.h
@@ -35,15 +35,17 @@ class OAuthClient : public gaia::GaiaOAuthClient::Delegate {
~OAuthClient() override;
- // Redeems |auth_code| using |oauth_client_info| to obtain |refresh_token| and
- // |access_token|, then uses the userinfo endpoint to obtain |user_email|.
- // Calls CompletionCallback with |user_email| and |refresh_token| when done,
- // or with empty strings on error.
- // If a request is received while another one is being processed, it is
- // enqueued and processed after the first one is finished.
+ // Redeems |auth_code| using |oauth_client_info| to obtain
+ // |refresh_token| and |access_token|, then, if |need_user_info| is
Lambros 2015/04/22 18:24:34 s/_info/_email/
John Williams 2015/04/22 20:11:25 Done.
+ // true, uses the userinfo endpoint to obtain |user_email|. Calls
+ // CompletionCallback with |user_email| and |refresh_token| when
+ // done, or with empty strings on error. If a request is received
+ // while another one is being processed, it is enqueued and
+ // processed after the first one is finished.
void GetCredentialsFromAuthCode(
const gaia::OAuthClientInfo& oauth_client_info,
const std::string& auth_code,
+ bool need_user_email,
CompletionCallback on_done);
// gaia::GaiaOAuthClient::Delegate
@@ -61,10 +63,12 @@ class OAuthClient : public gaia::GaiaOAuthClient::Delegate {
struct Request {
Request(const gaia::OAuthClientInfo& oauth_client_info,
const std::string& auth_code,
+ bool need_user_email,
CompletionCallback on_done);
virtual ~Request();
gaia::OAuthClientInfo oauth_client_info;
std::string auth_code;
+ bool need_user_email;
CompletionCallback on_done;
};
@@ -74,6 +78,7 @@ class OAuthClient : public gaia::GaiaOAuthClient::Delegate {
std::queue<Request> pending_requests_;
gaia::GaiaOAuthClient gaia_oauth_client_;
std::string refresh_token_;
+ bool need_user_email_;
CompletionCallback on_done_;
DISALLOW_COPY_AND_ASSIGN(OAuthClient);

Powered by Google App Engine
This is Rietveld 408576698