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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 domain.obj()); | 99 domain.obj()); |
100 #endif | 100 #endif |
101 } | 101 } |
102 | 102 |
103 void SigninManagerAndroid::FetchPolicyBeforeSignIn(JNIEnv* env, jobject obj) { | 103 void SigninManagerAndroid::FetchPolicyBeforeSignIn(JNIEnv* env, jobject obj) { |
104 #if defined(ENABLE_CONFIGURATION_POLICY) | 104 #if defined(ENABLE_CONFIGURATION_POLICY) |
105 if (cloud_policy_client_) { | 105 if (cloud_policy_client_) { |
106 policy::UserPolicySigninService* service = | 106 policy::UserPolicySigninService* service = |
107 policy::UserPolicySigninServiceFactory::GetForProfile(profile_); | 107 policy::UserPolicySigninServiceFactory::GetForProfile(profile_); |
108 service->FetchPolicyForSignedInUser( | 108 service->FetchPolicyForSignedInUser( |
| 109 username_, |
109 cloud_policy_client_.Pass(), | 110 cloud_policy_client_.Pass(), |
110 base::Bind(&SigninManagerAndroid::OnPolicyFetchDone, | 111 base::Bind(&SigninManagerAndroid::OnPolicyFetchDone, |
111 weak_factory_.GetWeakPtr())); | 112 weak_factory_.GetWeakPtr())); |
112 return; | 113 return; |
113 } | 114 } |
114 #endif | 115 #endif |
115 // This shouldn't be called when ShouldLoadPolicyForUser() is false, or when | 116 // This shouldn't be called when ShouldLoadPolicyForUser() is false, or when |
116 // CheckPolicyBeforeSignIn() failed. | 117 // CheckPolicyBeforeSignIn() failed. |
117 NOTREACHED(); | 118 NOTREACHED(); |
118 Java_SigninManager_onPolicyFetchedBeforeSignIn(env, | 119 Java_SigninManager_onPolicyFetchedBeforeSignIn(env, |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 return !policy::BrowserPolicyConnector::IsNonEnterpriseUser(username); | 221 return !policy::BrowserPolicyConnector::IsNonEnterpriseUser(username); |
221 #else | 222 #else |
222 return false; | 223 return false; |
223 #endif | 224 #endif |
224 } | 225 } |
225 | 226 |
226 // static | 227 // static |
227 bool SigninManagerAndroid::Register(JNIEnv* env) { | 228 bool SigninManagerAndroid::Register(JNIEnv* env) { |
228 return RegisterNativesImpl(env); | 229 return RegisterNativesImpl(env); |
229 } | 230 } |
OLD | NEW |