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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/android/profiles/profile_downloader_android.h" 5 #include "chrome/browser/android/profiles/profile_downloader_android.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_string.h" 8 #include "base/android/jni_string.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/profiles/profile_android.h" 10 #include "chrome/browser/profiles/profile_android.h"
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 void StartFetchingAccountInfoFor( 178 void StartFetchingAccountInfoFor(
179 JNIEnv* env, 179 JNIEnv* env,
180 jclass clazz, 180 jclass clazz,
181 jobject jprofile, 181 jobject jprofile,
182 jstring jemail, 182 jstring jemail,
183 jint image_side_pixels, 183 jint image_side_pixels,
184 jboolean is_pre_signin) { 184 jboolean is_pre_signin) {
185 Profile* profile = ProfileAndroid::FromProfileAndroid(jprofile); 185 Profile* profile = ProfileAndroid::FromProfileAndroid(jprofile);
186 const std::string email = 186 const std::string email =
187 base::android::ConvertJavaStringToUTF8(env, jemail); 187 base::android::ConvertJavaStringToUTF8(env, jemail);
188 // TODO(rogerta): the java code will need to pass in the gaia-id 188 AccountTrackerService* account_tracker_service =
189 // of the account instead of the email when chrome uses gaia-id as key. 189 AccountTrackerServiceFactory::GetForProfile(profile);
190 DCHECK_EQ(AccountTrackerService::MIGRATION_NOT_STARTED, 190
191 AccountTrackerServiceFactory::GetForProfile(profile)-> 191 AccountInfoRetriever* retriever = new AccountInfoRetriever(
192 GetMigrationState()); 192 profile,
193 AccountInfoRetriever* retriever = 193 account_tracker_service->FindAccountInfoByEmail(email).account_id, email,
nyquist 2015/08/28 19:18:26 Is FindAccountInfoByEmail guaranteed to find the a
gogerald1 2015/08/28 21:38:46 Yes, it is guaranteed, since ProfileDownloader.jav
194 new AccountInfoRetriever( 194 image_side_pixels, is_pre_signin);
195 profile, gaia::CanonicalizeEmail(gaia::SanitizeEmail(email)), email,
196 image_side_pixels, is_pre_signin);
197 retriever->Start(); 195 retriever->Start();
198 } 196 }
199 197
200 // static 198 // static
201 bool RegisterProfileDownloader(JNIEnv* env) { 199 bool RegisterProfileDownloader(JNIEnv* env) {
202 return RegisterNativesImpl(env); 200 return RegisterNativesImpl(env);
203 } 201 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698