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

Unified Diff: chrome/browser/profiles/profile_downloader.h

Issue 257773002: Use new people.get api instead of oauth2/v1/userinfo. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix user image manager tests 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: chrome/browser/profiles/profile_downloader.h
diff --git a/chrome/browser/profiles/profile_downloader.h b/chrome/browser/profiles/profile_downloader.h
index 8faf26d6ef0e047fbbe9bdb6a33dc7eedf4b3a6c..a1787731f855728eeb8377aa7a4627d8451ae6ad 100644
--- a/chrome/browser/profiles/profile_downloader.h
+++ b/chrome/browser/profiles/profile_downloader.h
@@ -12,6 +12,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/strings/string16.h"
#include "chrome/browser/image_decoder.h"
+#include "google_apis/gaia/gaia_oauth_client.h"
#include "google_apis/gaia/oauth2_token_service.h"
#include "net/url_request/url_fetcher_delegate.h"
#include "third_party/skia/include/core/SkBitmap.h"
@@ -26,7 +27,8 @@ class URLFetcher;
// Downloads user profile information. The profile picture is decoded in a
// sandboxed process.
-class ProfileDownloader : public net::URLFetcherDelegate,
+class ProfileDownloader : public gaia::GaiaOAuthClient::Delegate,
+ public net::URLFetcherDelegate,
public ImageDecoder::Delegate,
public OAuth2TokenService::Observer,
public OAuth2TokenService::Consumer {
@@ -80,6 +82,12 @@ class ProfileDownloader : public net::URLFetcherDelegate,
FRIEND_TEST_ALL_PREFIXES(ProfileDownloaderTest, ParseData);
FRIEND_TEST_ALL_PREFIXES(ProfileDownloaderTest, DefaultURL);
+ // 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;
+
// Overriden from net::URLFetcherDelegate:
virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE;
@@ -101,7 +109,7 @@ class ProfileDownloader : public net::URLFetcherDelegate,
// Parses the entry response and gets the name, profile image URL and locale.
// |data| should be the JSON formatted data return by the response.
// Returns false to indicate a parsing error.
- static bool ParseProfileJSON(const std::string& data,
+ static bool ParseProfileJSON(base::DictionaryValue* root_dictionary,
base::string16* full_name,
base::string16* given_name,
std::string* url,
@@ -123,7 +131,7 @@ class ProfileDownloader : public net::URLFetcherDelegate,
ProfileDownloaderDelegate* delegate_;
std::string account_id_;
std::string auth_token_;
- scoped_ptr<net::URLFetcher> user_entry_fetcher_;
+ scoped_ptr<gaia::GaiaOAuthClient> gaia_client_;
scoped_ptr<net::URLFetcher> profile_image_fetcher_;
scoped_ptr<OAuth2TokenService::Request> oauth2_access_token_request_;
base::string16 profile_full_name_;
« no previous file with comments | « chrome/browser/policy/cloud/user_policy_signin_service_unittest.cc ('k') | chrome/browser/profiles/profile_downloader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698