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

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

Issue 8742009: Cache GAIA profile picture URL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test 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 2d30e7d6420a710b3bd0d53a6a44fac14a3d646f..4e15a47fa5d7ad215477463bb74f116a6c16c575 100644
--- a/chrome/browser/profiles/profile_downloader.h
+++ b/chrome/browser/profiles/profile_downloader.h
@@ -29,6 +29,13 @@ class ProfileDownloader : public content::URLFetcherDelegate,
public content::NotificationObserver,
public OAuth2AccessTokenConsumer {
public:
+ enum PictureStatus {
+ PICTURE_SUCCESS,
+ PICTURE_FAILED,
+ PICTURE_DEFAULT,
+ PICTURE_CACHED,
+ };
+
explicit ProfileDownloader(ProfileDownloaderDelegate* delegate);
virtual ~ProfileDownloader();
@@ -46,6 +53,14 @@ class ProfileDownloader : public content::URLFetcherDelegate,
// profile picture) this will return an Null bitmap.
virtual SkBitmap GetProfilePicture() const;
+ // Gets the profile picture status.
+ virtual PictureStatus GetProfilePictureStatus() const;
+
+ // Gets the URL for the profile picture. This can be cached so that the same
+ // picture is not downloaded multiple times. This value should only be used
+ // when the picture status is PICTURE_SUCCESS.
+ virtual std::string GetProfilePictureURL() const;
+
private:
// Overriden from content::URLFetcherDelegate:
virtual void OnURLFetchComplete(const content::URLFetcher* source) OVERRIDE;
@@ -91,6 +106,8 @@ class ProfileDownloader : public content::URLFetcherDelegate,
content::NotificationRegistrar registrar_;
string16 profile_full_name_;
SkBitmap profile_picture_;
+ PictureStatus picture_status_;
+ std::string picture_url_;
DISALLOW_COPY_AND_ASSIGN(ProfileDownloader);
};
« no previous file with comments | « chrome/browser/profiles/gaia_info_update_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