Chromium Code Reviews| 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 DCHECK(g_browser_process); |
|
Yaron
2014/01/06 22:00:17
Actually can you drop these two DCHECKs. They seem
Mr4D (OOO till 08-26)
2014/01/07 17:12:16
Done.
| |
| 78 DCHECK(g_browser_process->profile_manager()); | 78 DCHECK(g_browser_process->profile_manager()); |
| 79 profile_ = g_browser_process->profile_manager()->GetDefaultProfile(); | 79 profile_ = ProfileManager::GetActiveUserProfile(); |
| 80 DCHECK(profile_); | 80 DCHECK(profile_); |
| 81 } | 81 } |
| 82 | 82 |
| 83 SigninManagerAndroid::~SigninManagerAndroid() {} | 83 SigninManagerAndroid::~SigninManagerAndroid() {} |
| 84 | 84 |
| 85 void SigninManagerAndroid::CheckPolicyBeforeSignIn(JNIEnv* env, | 85 void SigninManagerAndroid::CheckPolicyBeforeSignIn(JNIEnv* env, |
| 86 jobject obj, | 86 jobject obj, |
| 87 jstring username) { | 87 jstring username) { |
| 88 #if defined(ENABLE_CONFIGURATION_POLICY) | 88 #if defined(ENABLE_CONFIGURATION_POLICY) |
| 89 username_ = base::android::ConvertJavaStringToUTF8(env, username); | 89 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); | 246 return !policy::BrowserPolicyConnector::IsNonEnterpriseUser(username); |
| 247 #else | 247 #else |
| 248 return false; | 248 return false; |
| 249 #endif | 249 #endif |
| 250 } | 250 } |
| 251 | 251 |
| 252 // static | 252 // static |
| 253 bool SigninManagerAndroid::Register(JNIEnv* env) { | 253 bool SigninManagerAndroid::Register(JNIEnv* env) { |
| 254 return RegisterNativesImpl(env); | 254 return RegisterNativesImpl(env); |
| 255 } | 255 } |
| OLD | NEW |