Chromium Code Reviews| 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 9560c8688455da5656f959884ac730a084c5de74..1c92de9bb51d26d48e6699df64be9e9a490b3816 100644 |
| --- a/chrome/browser/android/profiles/profile_downloader_android.cc |
| +++ b/chrome/browser/android/profiles/profile_downloader_android.cc |
| @@ -185,15 +185,20 @@ void StartFetchingAccountInfoFor( |
| Profile* profile = ProfileAndroid::FromProfileAndroid(jprofile); |
| 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. |
| - DCHECK_EQ(AccountTrackerService::MIGRATION_NOT_STARTED, |
| - AccountTrackerServiceFactory::GetForProfile(profile)-> |
| - GetMigrationState()); |
| - AccountInfoRetriever* retriever = |
| - new AccountInfoRetriever( |
| - profile, gaia::CanonicalizeEmail(gaia::SanitizeEmail(email)), email, |
| - image_side_pixels, is_pre_signin); |
| + |
| + std::string account_id = gaia::CanonicalizeEmail(gaia::SanitizeEmail(email)); |
| + AccountTrackerService* account_tracker_service = |
| + AccountTrackerServiceFactory::GetForProfile(profile); |
| + if (account_tracker_service->GetMigrationState() != |
| + AccountTrackerService::MIGRATION_NOT_STARTED) { |
| + std::string accountid = |
|
Roger Tawa OOO till Jul 10th
2015/08/12 15:28:46
This variable name is too similar with account_id.
gogerald1
2015/08/13 18:12:12
Acknowledged.
|
| + account_tracker_service->FindAccountInfoByEmail(email).gaia; |
|
Roger Tawa OOO till Jul 10th
2015/08/12 15:28:46
If migration state != NOT_STARTED, then FindAccoun
gogerald1
2015/08/13 18:12:12
Done.
|
| + if (!accountid.empty()) |
| + account_id = accountid; |
| + } |
| + |
| + AccountInfoRetriever* retriever = new AccountInfoRetriever( |
| + profile, account_id, email, image_side_pixels, is_pre_signin); |
| retriever->Start(); |
| } |