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

Unified Diff: chrome/browser/chromeos/login/profile_image_downloader.cc

Issue 8490012: [cros] Fix default profile photo detection. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename constants. 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/profile_image_downloader.cc
diff --git a/chrome/browser/chromeos/login/profile_image_downloader.cc b/chrome/browser/chromeos/login/profile_image_downloader.cc
index c4dbc9ed4c4106f6e7da4911daef2ad2c51f3a43..475d94896d5b3eb5aa46fa4c06f2bc9b426514f8 100644
--- a/chrome/browser/chromeos/login/profile_image_downloader.cc
+++ b/chrome/browser/chromeos/login/profile_image_downloader.cc
@@ -51,14 +51,17 @@ const int kDefaultThumbnailSize = 64;
// Separator of URL path components.
const char kURLPathSeparator = '/';
-// Photo ID of old low-res default profile picture (base64 of 0).
-const char kOldDefaultPhotoId[] = "AAAAAAAAAAA";
+// Photo ID of the Picasa Web Albums profile picture (base64 of 0).
+const char kPicasaPhotoId[] = "AAAAAAAAAAA";
-// Current photo ID of the current profile picture (base64 of 2).
-const char kDefaultPhotoId[] = "AAAAAAAAAAI";
+// Photo version of the default PWA profile picture (base64 of 1).
+const char kDefaultPicasaPhotoVersion[] = "AAAAAAAAAAE";
-// Photo version of the current profile picture (base64 of 0).
-const char kDefaultPhotoVersion[] = "AAAAAAAAAAA";
+// Photo ID of the Google+ profile picture (base64 of 2).
+const char kGooglePlusPhotoId[] = "AAAAAAAAAAI";
+
+// Photo version of the default Google+ profile picture (base64 of 0).
+const char kDefaultGooglePlusPhotoVersion[] = "AAAAAAAAAAA";
// Number of path components in profile picture URL.
const size_t kProfileImageURLPathComponentsCount = 7;
@@ -147,9 +150,13 @@ bool ProfileImageDownloader::IsDefaultProfileImageURL(
const std::string& photo_id = path_components[kPhotoIdPathComponentIndex];
const std::string& photo_version =
path_components[kPhotoVersionPathComponentIndex];
- return (photo_id == kOldDefaultPhotoId) ||
- (photo_id == kDefaultPhotoId &&
- photo_version == kDefaultPhotoVersion);
+
+ // There are at least two pairs of (ID, version) for the default photo:
+ // the default Google+ profile photo and the default Picasa profile photo.
+ return ((photo_id == kPicasaPhotoId &&
+ photo_version == kDefaultPicasaPhotoVersion) ||
+ (photo_id == kGooglePlusPhotoId &&
+ photo_version == kDefaultGooglePlusPhotoVersion));
}
ProfileImageDownloader::ProfileImageDownloader(Delegate* delegate)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698