Index: chrome/browser/android/signin/account_tracker_service_android.cc |
diff --git a/chrome/browser/android/signin/account_tracker_service_android.cc b/chrome/browser/android/signin/account_tracker_service_android.cc |
index 26a2590c2742db764da83d3f120c735f0903d525..f234aa577b5a94d1dc1b45961ca626015c7bdb2d 100644 |
--- a/chrome/browser/android/signin/account_tracker_service_android.cc |
+++ b/chrome/browser/android/signin/account_tracker_service_android.cc |
@@ -6,19 +6,19 @@ |
#include "base/android/jni_array.h" |
#include "chrome/browser/profiles/profile_manager.h" |
+#include "chrome/browser/signin/account_fetcher_service_factory.h" |
#include "chrome/browser/signin/account_tracker_service_factory.h" |
-#include "components/signin/core/browser/account_info.h" |
+#include "components/signin/core/browser/account_fetcher_service.h" |
+#include "components/signin/core/browser/account_tracker_service.h" |
#include "jni/AccountTrackerService_jni.h" |
-AccountTrackerServiceAndroid::AccountTrackerServiceAndroid(JNIEnv* env, |
- jobject obj) { |
- java_account_tracker_service_.Reset(env, obj); |
-} |
+namespace signin { |
+namespace android { |
-void AccountTrackerServiceAndroid::SeedAccountsInfo(JNIEnv* env, |
- jobject obj, |
- jobjectArray gaiaIds, |
- jobjectArray accountNames) { |
+void SeedAccountsInfo(JNIEnv* env, |
+ const JavaParamRef<jclass>& jcaller, |
+ const JavaParamRef<jobjectArray>& gaiaIds, |
+ const JavaParamRef<jobjectArray>& accountNames) { |
std::vector<std::string> gaia_ids; |
std::vector<std::string> account_names; |
base::android::AppendJavaStringArrayToStringVector(env, gaiaIds, &gaia_ids); |
@@ -32,18 +32,22 @@ void AccountTrackerServiceAndroid::SeedAccountsInfo(JNIEnv* env, |
AccountTrackerService* account_tracker_service_ = |
AccountTrackerServiceFactory::GetForProfile(profile); |
- for (unsigned int i = 0; i < gaia_ids.size(); i++) { |
+ for (size_t i = 0; i < gaia_ids.size(); i++) { |
account_tracker_service_->SeedAccountInfo(gaia_ids[i], account_names[i]); |
} |
+ AccountFetcherServiceFactory::GetForProfile(profile)->OnAccountsSeeded(); |
anthonyvd
2015/10/05 16:05:50
The idea behind splitting the AFS into the tracker
knn
2015/10/05 16:35:55
That ordering is still maintained (ATS does not kn
anthonyvd
2015/10/05 20:45:21
My bad, I thought the AccountTrackerServiceAndroid
|
} |
-static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { |
- AccountTrackerServiceAndroid* account_tracker_service_android = |
- new AccountTrackerServiceAndroid(env, obj); |
- return reinterpret_cast<intptr_t>(account_tracker_service_android); |
+jboolean AreAllAccountsSeeded(JNIEnv* env, |
+ const JavaParamRef<jclass>& jcaller) { |
+ Profile* profile = ProfileManager::GetActiveUserProfile(); |
+ return AccountFetcherServiceFactory::GetForProfile(profile) |
+ ->AreAllAccountsSeeded(); |
} |
-// static |
-bool AccountTrackerServiceAndroid::Register(JNIEnv* env) { |
+bool RegisterAccountTrackerService(JNIEnv* env) { |
return RegisterNativesImpl(env); |
} |
+ |
+} // namespace android |
+} // namespace signin |