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

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: correct branch 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
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..786f9581aeb38ab55e5e8fe7ce470a7381c6e0ad 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,14 @@ class ProfileDownloader : public content::URLFetcherDelegate,
// Issues the first request to get user profile image.
void StartFetchingImage();
+ // Gets the authorization header.
+ const char* GetAuthorizationHeader() const;
+
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_;

Powered by Google App Engine
This is Rietveld 408576698