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

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

Issue 8746002: Use OAuth2 refresh token to download GAIA info (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix observer Created 9 years, 1 month 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/browser/profiles/gaia_info_update_service.cc ('k') | chrome/browser/profiles/profile_downloader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_downloader.h
diff --git a/chrome/browser/profiles/profile_downloader.h b/chrome/browser/profiles/profile_downloader.h
index 6f4d1ec5f6f264ac529e9e6edfa5a8bc3be09c87..2d30e7d6420a710b3bd0d53a6a44fac14a3d646f 100644
--- a/chrome/browser/profiles/profile_downloader.h
+++ b/chrome/browser/profiles/profile_downloader.h
@@ -17,14 +17,17 @@
#include "content/public/common/url_fetcher_delegate.h"
#include "googleurl/src/gurl.h"
#include "third_party/skia/include/core/SkBitmap.h"
+#include "chrome/common/net/gaia/oauth2_access_token_consumer.h"
class ProfileDownloaderDelegate;
+class OAuth2AccessTokenFetcher;
// Downloads user profile information. The profile picture is decoded in a
// sandboxed process.
class ProfileDownloader : public content::URLFetcherDelegate,
public ImageDecoder::Delegate,
- public content::NotificationObserver {
+ public content::NotificationObserver,
+ public OAuth2AccessTokenConsumer {
public:
explicit ProfileDownloader(ProfileDownloaderDelegate* delegate);
virtual ~ProfileDownloader();
@@ -57,6 +60,10 @@ class ProfileDownloader : public content::URLFetcherDelegate,
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE;
+ // Overriden from OAuth2AccessTokenConsumer:
+ virtual void OnGetTokenSuccess(const std::string& access_token) OVERRIDE;
+ virtual void OnGetTokenFailure(const GoogleServiceAuthError& error) OVERRIDE;
+
// Parses the entry response from Picasa and gets the nick name and
// and profile image URL. Returns false to indicate a parsing error.
bool GetProfileNickNameAndImageURL(const std::string& data,
@@ -69,10 +76,18 @@ class ProfileDownloader : public content::URLFetcherDelegate,
// Issues the first request to get user profile image.
void StartFetchingImage();
+ // Gets the authorization header.
+ const char* GetAuthorizationHeader() const;
+
+ // Starts fetching OAuth2 access token. This is needed before the GAIA info
+ // can be downloaded.
+ void StartFetchingOAuth2AccessToken();
+
ProfileDownloaderDelegate* delegate_;
std::string auth_token_;
scoped_ptr<content::URLFetcher> user_entry_fetcher_;
scoped_ptr<content::URLFetcher> profile_image_fetcher_;
+ scoped_ptr<OAuth2AccessTokenFetcher> oauth2_access_token_fetcher_;
content::NotificationRegistrar registrar_;
string16 profile_full_name_;
SkBitmap profile_picture_;
« no previous file with comments | « chrome/browser/profiles/gaia_info_update_service.cc ('k') | chrome/browser/profiles/profile_downloader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698