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

Unified Diff: chrome/browser/android/profiles/profile_downloader_android.cc

Issue 1256283002: GAIA ID migration for Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: full version Created 5 years, 4 months 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/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..0281dc4ef371dc4a87a1311967da7780b027ca26 100644
--- a/chrome/browser/android/profiles/profile_downloader_android.cc
+++ b/chrome/browser/android/profiles/profile_downloader_android.cc
@@ -185,15 +185,18 @@ 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) {
+ account_id = account_tracker_service->FindAccountInfoByEmail(email).gaia;
+ DCHECK(!account_id.empty());
+ }
+
+ AccountInfoRetriever* retriever = new AccountInfoRetriever(
+ profile, account_id, email, image_side_pixels, is_pre_signin);
retriever->Start();
}

Powered by Google App Engine
This is Rietveld 408576698