| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/signin/signin_manager_android.h" | 5 #include "chrome/browser/android/signin/signin_manager_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 "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 | 67 |
| 68 DISALLOW_COPY_AND_ASSIGN(ProfileDataRemover); | 68 DISALLOW_COPY_AND_ASSIGN(ProfileDataRemover); |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 } // namespace | 71 } // namespace |
| 72 | 72 |
| 73 SigninManagerAndroid::SigninManagerAndroid(JNIEnv* env, jobject obj) | 73 SigninManagerAndroid::SigninManagerAndroid(JNIEnv* env, jobject obj) |
| 74 : profile_(NULL), | 74 : profile_(NULL), |
| 75 weak_factory_(this) { | 75 weak_factory_(this) { |
| 76 java_signin_manager_.Reset(env, obj); | 76 java_signin_manager_.Reset(env, obj); |
| 77 DCHECK(g_browser_process); | 77 profile_ = ProfileManager::GetActiveUserProfile(); |
| 78 DCHECK(g_browser_process->profile_manager()); | |
| 79 profile_ = g_browser_process->profile_manager()->GetDefaultProfile(); | |
| 80 DCHECK(profile_); | 78 DCHECK(profile_); |
| 81 } | 79 } |
| 82 | 80 |
| 83 SigninManagerAndroid::~SigninManagerAndroid() {} | 81 SigninManagerAndroid::~SigninManagerAndroid() {} |
| 84 | 82 |
| 85 void SigninManagerAndroid::CheckPolicyBeforeSignIn(JNIEnv* env, | 83 void SigninManagerAndroid::CheckPolicyBeforeSignIn(JNIEnv* env, |
| 86 jobject obj, | 84 jobject obj, |
| 87 jstring username) { | 85 jstring username) { |
| 88 #if defined(ENABLE_CONFIGURATION_POLICY) | 86 #if defined(ENABLE_CONFIGURATION_POLICY) |
| 89 username_ = base::android::ConvertJavaStringToUTF8(env, username); | 87 username_ = base::android::ConvertJavaStringToUTF8(env, username); |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 return !policy::BrowserPolicyConnector::IsNonEnterpriseUser(username); | 244 return !policy::BrowserPolicyConnector::IsNonEnterpriseUser(username); |
| 247 #else | 245 #else |
| 248 return false; | 246 return false; |
| 249 #endif | 247 #endif |
| 250 } | 248 } |
| 251 | 249 |
| 252 // static | 250 // static |
| 253 bool SigninManagerAndroid::Register(JNIEnv* env) { | 251 bool SigninManagerAndroid::Register(JNIEnv* env) { |
| 254 return RegisterNativesImpl(env); | 252 return RegisterNativesImpl(env); |
| 255 } | 253 } |
| OLD | NEW |