| Index: chrome/browser/supervised_user/child_accounts/child_account_service_android.cc
|
| diff --git a/chrome/browser/supervised_user/child_accounts/child_account_service_android.cc b/chrome/browser/supervised_user/child_accounts/child_account_service_android.cc
|
| index 6abbec98d9efb835953863ab865b5637e145c6ad..6d23de999736313b181786686fc0aa36c40424be 100644
|
| --- a/chrome/browser/supervised_user/child_accounts/child_account_service_android.cc
|
| +++ b/chrome/browser/supervised_user/child_accounts/child_account_service_android.cc
|
| @@ -7,59 +7,18 @@
|
| #include "chrome/browser/browser_process.h"
|
| #include "chrome/browser/profiles/profile_manager.h"
|
| #include "chrome/browser/supervised_user/child_accounts/child_account_service.h"
|
| -#include "chrome/browser/supervised_user/child_accounts/child_account_service_factory.h"
|
| #include "jni/ChildAccountService_jni.h"
|
|
|
| -namespace {
|
| -
|
| -bool g_is_child_account = false;
|
| -bool g_has_child_account_status = false;
|
| -
|
| -} // namespace
|
| -
|
| jboolean IsChildAccountDetectionEnabled(JNIEnv* env,
|
| - const JavaParamRef<jobject>& obj) {
|
| + const JavaParamRef<jclass>& jcaller) {
|
| return ChildAccountService::IsChildAccountDetectionEnabled();
|
| }
|
|
|
| -jboolean GetIsChildAccount(JNIEnv* env, const JavaParamRef<jobject>& obj) {
|
| +jboolean IsChildAccount(JNIEnv* env, const JavaParamRef<jclass>& jcaller) {
|
| ProfileManager* profile_manager = g_browser_process->profile_manager();
|
| return profile_manager->GetLastUsedProfile()->IsChild();
|
| }
|
|
|
| -void SetIsChildAccount(JNIEnv* env,
|
| - const JavaParamRef<jobject>& obj,
|
| - jboolean is_child) {
|
| - VLOG(1) << "OnChildAccountSigninComplete";
|
| -
|
| - // If the browser process has not been created yet, store the child account
|
| - // status and return it later in GetJavaChildAccountStatus().
|
| - if (!g_browser_process) {
|
| - g_has_child_account_status = true;
|
| - g_is_child_account = is_child;
|
| - return;
|
| - }
|
| -
|
| - ProfileManager* profile_manager = g_browser_process->profile_manager();
|
| - Profile* profile = profile_manager->GetLastUsedProfile();
|
| - ChildAccountServiceFactory::GetForProfile(profile)
|
| - ->SetIsChildAccount(is_child);
|
| -}
|
| -
|
| -bool GetJavaChildAccountStatus(bool* is_child_account) {
|
| - if (!g_has_child_account_status)
|
| - return false;
|
| -
|
| - *is_child_account = g_is_child_account;
|
| - g_has_child_account_status = false;
|
| - return true;
|
| -}
|
| -
|
| -void ChildStatusInvalidationReceived() {
|
| - JNIEnv* env = base::android::AttachCurrentThread();
|
| - Java_ChildAccountService_onInvalidationReceived(env);
|
| -}
|
| -
|
| bool RegisterChildAccountService(JNIEnv* env) {
|
| return RegisterNativesImpl(env);
|
| }
|
|
|