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

Unified Diff: components/policy/core/common/cloud/user_info_fetcher.h

Issue 265563002: Revert of Use new people.get api instead of oauth2/v1/userinfo. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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: components/policy/core/common/cloud/user_info_fetcher.h
diff --git a/components/policy/core/common/cloud/user_info_fetcher.h b/components/policy/core/common/cloud/user_info_fetcher.h
index 0f4c25f533daa17808e3a237945ca1e26ee2b42e..c248d81b06852ccdddc8f5318a6fd8ed5f724d0b 100644
--- a/components/policy/core/common/cloud/user_info_fetcher.h
+++ b/components/policy/core/common/cloud/user_info_fetcher.h
@@ -8,7 +8,6 @@
#include <string>
#include "base/memory/scoped_ptr.h"
#include "components/policy/policy_export.h"
-#include "google_apis/gaia/gaia_oauth_client.h"
#include "net/url_request/url_fetcher_delegate.h"
class GoogleServiceAuthError;
@@ -26,7 +25,7 @@
// Class that makes a UserInfo request, parses the response, and notifies
// a provided Delegate when the request is complete.
-class POLICY_EXPORT UserInfoFetcher {
+class POLICY_EXPORT UserInfoFetcher : public net::URLFetcherDelegate {
public:
class POLICY_EXPORT Delegate {
public:
@@ -49,25 +48,13 @@
// Starts the UserInfo request, using the passed OAuth2 |access_token|.
void Start(const std::string& access_token);
+ // net::URLFetcherDelegate implementation.
+ virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE;
+
private:
- class GaiaDelegate : public gaia::GaiaOAuthClient::Delegate {
- public:
- explicit GaiaDelegate(UserInfoFetcher::Delegate* delegate);
-
- private:
- // gaia::GaiaOAuthClient::Delegate implementation.
- virtual void OnGetUserInfoResponse(
- scoped_ptr<base::DictionaryValue> user_info) OVERRIDE;
- virtual void OnOAuthError() OVERRIDE;
- virtual void OnNetworkError(int response_code) OVERRIDE;
-
- UserInfoFetcher::Delegate* delegate_;
-
- DISALLOW_COPY_AND_ASSIGN(GaiaDelegate);
- };
-
- GaiaDelegate delegate_;
- gaia::GaiaOAuthClient gaia_client_;
+ Delegate* delegate_;
+ net::URLRequestContextGetter* context_;
+ scoped_ptr<net::URLFetcher> url_fetcher_;
DISALLOW_COPY_AND_ASSIGN(UserInfoFetcher);
};

Powered by Google App Engine
This is Rietveld 408576698