| 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 void SigninManagerAndroid::SignOut(JNIEnv* env, jobject obj) { | 130 void SigninManagerAndroid::SignOut(JNIEnv* env, jobject obj) { |
| 131 SigninManagerFactory::GetForProfile(profile_)->SignOut(); | 131 SigninManagerFactory::GetForProfile(profile_)->SignOut(); |
| 132 } | 132 } |
| 133 | 133 |
| 134 base::android::ScopedJavaLocalRef<jstring> | 134 base::android::ScopedJavaLocalRef<jstring> |
| 135 SigninManagerAndroid::GetManagementDomain(JNIEnv* env, jobject obj) { | 135 SigninManagerAndroid::GetManagementDomain(JNIEnv* env, jobject obj) { |
| 136 base::android::ScopedJavaLocalRef<jstring> domain; | 136 base::android::ScopedJavaLocalRef<jstring> domain; |
| 137 | 137 |
| 138 #if defined(ENABLE_CONFIGURATION_POLICY) | 138 #if defined(ENABLE_CONFIGURATION_POLICY) |
| 139 policy::UserCloudPolicyManager* manager = | 139 policy::UserCloudPolicyManager* manager = |
| 140 policy::UserCloudPolicyManagerFactory::GetForProfile(profile_); | 140 policy::UserCloudPolicyManagerFactory::GetForBrowserContext(profile_); |
| 141 policy::CloudPolicyStore* store = manager->core()->store(); | 141 policy::CloudPolicyStore* store = manager->core()->store(); |
| 142 | 142 |
| 143 if (store && store->is_managed() && store->policy()->has_username()) { | 143 if (store && store->is_managed() && store->policy()->has_username()) { |
| 144 domain.Reset( | 144 domain.Reset( |
| 145 base::android::ConvertUTF8ToJavaString( | 145 base::android::ConvertUTF8ToJavaString( |
| 146 env, gaia::ExtractDomainName(store->policy()->username()))); | 146 env, gaia::ExtractDomainName(store->policy()->username()))); |
| 147 } | 147 } |
| 148 #endif | 148 #endif |
| 149 | 149 |
| 150 return domain; | 150 return domain; |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 return !policy::BrowserPolicyConnector::IsNonEnterpriseUser(username); | 221 return !policy::BrowserPolicyConnector::IsNonEnterpriseUser(username); |
| 222 #else | 222 #else |
| 223 return false; | 223 return false; |
| 224 #endif | 224 #endif |
| 225 } | 225 } |
| 226 | 226 |
| 227 // static | 227 // static |
| 228 bool SigninManagerAndroid::Register(JNIEnv* env) { | 228 bool SigninManagerAndroid::Register(JNIEnv* env) { |
| 229 return RegisterNativesImpl(env); | 229 return RegisterNativesImpl(env); |
| 230 } | 230 } |
| OLD | NEW |