| OLD | NEW |
| 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 // static | 180 // static |
| 181 void StartFetchingAccountInfoFor(JNIEnv* env, | 181 void StartFetchingAccountInfoFor(JNIEnv* env, |
| 182 const JavaParamRef<jclass>& clazz, | 182 const JavaParamRef<jclass>& clazz, |
| 183 const JavaParamRef<jobject>& jprofile, | 183 const JavaParamRef<jobject>& jprofile, |
| 184 const JavaParamRef<jstring>& jemail, | 184 const JavaParamRef<jstring>& jemail, |
| 185 jint image_side_pixels, | 185 jint image_side_pixels, |
| 186 jboolean is_pre_signin) { | 186 jboolean is_pre_signin) { |
| 187 Profile* profile = ProfileAndroid::FromProfileAndroid(jprofile); | 187 Profile* profile = ProfileAndroid::FromProfileAndroid(jprofile); |
| 188 const std::string email = | 188 const std::string email = |
| 189 base::android::ConvertJavaStringToUTF8(env, jemail); | 189 base::android::ConvertJavaStringToUTF8(env, jemail); |
| 190 // TODO(rogerta): the java code will need to pass in the gaia-id | 190 AccountTrackerService* account_tracker_service = |
| 191 // of the account instead of the email when chrome uses gaia-id as key. | 191 AccountTrackerServiceFactory::GetForProfile(profile); |
| 192 DCHECK_EQ(AccountTrackerService::MIGRATION_NOT_STARTED, | 192 |
| 193 AccountTrackerServiceFactory::GetForProfile(profile)-> | 193 AccountInfoRetriever* retriever = new AccountInfoRetriever( |
| 194 GetMigrationState()); | 194 profile, |
| 195 AccountInfoRetriever* retriever = | 195 account_tracker_service->FindAccountInfoByEmail(email).account_id, email, |
| 196 new AccountInfoRetriever( | 196 image_side_pixels, is_pre_signin); |
| 197 profile, gaia::CanonicalizeEmail(gaia::SanitizeEmail(email)), email, | |
| 198 image_side_pixels, is_pre_signin); | |
| 199 retriever->Start(); | 197 retriever->Start(); |
| 200 } | 198 } |
| 201 | 199 |
| 202 // static | 200 // static |
| 203 bool RegisterProfileDownloader(JNIEnv* env) { | 201 bool RegisterProfileDownloader(JNIEnv* env) { |
| 204 return RegisterNativesImpl(env); | 202 return RegisterNativesImpl(env); |
| 205 } | 203 } |
| OLD | NEW |