Chromium Code Reviews| Index: remoting/host/setup/gaia_oauth_client.h |
| diff --git a/remoting/host/setup/oauth_client.h b/remoting/host/setup/gaia_oauth_client.h |
| similarity index 72% |
| copy from remoting/host/setup/oauth_client.h |
| copy to remoting/host/setup/gaia_oauth_client.h |
| index 5cc8f1f3bcfe099ac1e6cacb25db9dd7adbd7cba..76ea7cdb4438e22f5b9627453f6d84ad4c145208 100644 |
| --- a/remoting/host/setup/oauth_client.h |
| +++ b/remoting/host/setup/gaia_oauth_client.h |
| @@ -2,38 +2,34 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#ifndef REMOTING_HOST_SETUP_OAUTH_CLIENT |
| -#define REMOTING_HOST_SETUP_OAUTH_CLIENT |
| +#ifndef REMOTING_HOST_SETUP_GAIA_OAUTH_CLIENT_H_ |
| +#define REMOTING_HOST_SETUP_GAIA_OAUTH_CLIENT_H_ |
| #include <queue> |
| -#include <string> |
| -#include "base/callback.h" |
| #include "base/memory/ref_counted.h" |
| #include "google_apis/gaia/gaia_oauth_client.h" |
| #include "net/url_request/url_request_context_getter.h" |
| +#include "remoting/host/setup/oauth_client.h" |
| + |
| namespace net { |
| class URLRequestContext; |
| } |
| namespace remoting { |
| -// A wrapper around GaiaOAuthClient that provides a more convenient interface, |
| -// with queueing of requests and a callback rather than a delegate. |
| -class OAuthClient : public gaia::GaiaOAuthClient::Delegate { |
| +// A wrapper around gaia::GaiaOAuthClient that provides a more |
| +// convenient interface, with queueing of requests and a callback |
| +// rather than a delegate. |
| +class GaiaOAuthClient : |
| + public OAuthClient, |
|
Lambros
2015/04/24 21:38:56
Move this to the line above. Then the next 'public
John Williams
2015/04/24 21:48:42
Done.
|
| + public gaia::GaiaOAuthClient::Delegate { |
| public: |
| - // Called when GetCredentialsFromAuthCode is completed, with the |user_email| |
| - // and |refresh_token| that correspond to the given |auth_code|, or with empty |
| - // strings on error. |
| - typedef base::Callback<void( |
| - const std::string& user_email, |
| - const std::string& refresh_token)> CompletionCallback; |
| - |
| - OAuthClient( |
| + GaiaOAuthClient( |
| scoped_refptr<net::URLRequestContextGetter> url_request_context_getter); |
| - ~OAuthClient() override; |
| + ~GaiaOAuthClient() override; |
| // Redeems |auth_code| using |oauth_client_info| to obtain |refresh_token| and |
| // |access_token|, then uses the userinfo endpoint to obtain |user_email|. |
| @@ -44,7 +40,7 @@ class OAuthClient : public gaia::GaiaOAuthClient::Delegate { |
| void GetCredentialsFromAuthCode( |
| const gaia::OAuthClientInfo& oauth_client_info, |
| const std::string& auth_code, |
| - CompletionCallback on_done); |
| + CompletionCallback on_done) override; |
| // gaia::GaiaOAuthClient::Delegate |
| void OnGetTokensResponse(const std::string& refresh_token, |
| @@ -76,9 +72,9 @@ class OAuthClient : public gaia::GaiaOAuthClient::Delegate { |
| std::string refresh_token_; |
| CompletionCallback on_done_; |
| - DISALLOW_COPY_AND_ASSIGN(OAuthClient); |
| + DISALLOW_COPY_AND_ASSIGN(GaiaOAuthClient); |
| }; |
| } // namespace remoting |
| -#endif // REMOTING_HOST_SETUP_OAUTH_CLIENT |
| +#endif // REMOTING_HOST_SETUP_GAIA_OAUTH_CLIENT_H_ |