| Index: chrome/browser/android/profiles/profile_downloader_android.cc
|
| diff --git a/chrome/browser/android/profiles/profile_downloader_android.cc b/chrome/browser/android/profiles/profile_downloader_android.cc
|
| index c6d4785fd1cec985a05acbbe5377fe369b89feff..8f50cb4803dcecdd811952e7442b25525487af19 100644
|
| --- a/chrome/browser/android/profiles/profile_downloader_android.cc
|
| +++ b/chrome/browser/android/profiles/profile_downloader_android.cc
|
| @@ -12,6 +12,7 @@
|
| #include "chrome/browser/profiles/profile_downloader.h"
|
| #include "chrome/browser/profiles/profile_downloader_delegate.h"
|
| #include "chrome/browser/profiles/profile_manager.h"
|
| +#include "google_apis/gaia/gaia_auth_util.h"
|
| #include "jni/ProfileDownloader_jni.h"
|
| #include "third_party/skia/include/core/SkBitmap.h"
|
| #include "ui/gfx/android/java_bitmap.h"
|
| @@ -25,9 +26,11 @@ class AccountInfoRetriever : public ProfileDownloaderDelegate {
|
| public:
|
| explicit AccountInfoRetriever(Profile* profile,
|
| const std::string& account_id,
|
| + const std::string& email,
|
| const int desired_image_side_pixels)
|
| : profile_(profile),
|
| account_id_(account_id),
|
| + email_(email),
|
| desired_image_side_pixels_(desired_image_side_pixels) {}
|
|
|
| void Start() {
|
| @@ -60,7 +63,7 @@ class AccountInfoRetriever : public ProfileDownloaderDelegate {
|
| virtual void OnProfileDownloadSuccess(
|
| ProfileDownloader* downloader) OVERRIDE {
|
| ProfileDownloaderAndroid::OnProfileDownloadSuccess(
|
| - account_id_,
|
| + email_,
|
| downloader->GetProfileFullName(),
|
| downloader->GetProfilePicture());
|
| Shutdown();
|
| @@ -79,8 +82,9 @@ class AccountInfoRetriever : public ProfileDownloaderDelegate {
|
| // The browser profile associated with this download request.
|
| Profile* profile_;
|
|
|
| - // The account ID (email address) to be loaded.
|
| + // The account ID and email address of account to be loaded.
|
| const std::string account_id_;
|
| + const std::string email_;
|
|
|
| // Desired side length of the profile image (in pixels).
|
| const int desired_image_side_pixels_;
|
| @@ -150,13 +154,16 @@ void StartFetchingAccountInfoFor(
|
| JNIEnv* env,
|
| jclass clazz,
|
| jobject jprofile,
|
| - jstring jaccount_id,
|
| + jstring jemail,
|
| jint image_side_pixels) {
|
| Profile* profile = ProfileAndroid::FromProfileAndroid(jprofile);
|
| - const std::string account_id =
|
| - base::android::ConvertJavaStringToUTF8(env, jaccount_id);
|
| + const std::string email =
|
| + base::android::ConvertJavaStringToUTF8(env, jemail);
|
| + // TODO(rogerta): the java code will need to pass in the gaia-id
|
| + // of the account instead of the email when chrome uses gaia-id as key.
|
| AccountInfoRetriever* retriever =
|
| - new AccountInfoRetriever(profile, account_id, image_side_pixels);
|
| + new AccountInfoRetriever(profile, gaia::CanonicalizeEmail(email), email,
|
| + image_side_pixels);
|
| retriever->Start();
|
| }
|
|
|
|
|