Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(226)

Side by Side Diff: chrome/browser/android/signin/signin_manager_android.cc

Issue 44083005: policy: Remove UserCloudPolicyManagerFactory's dependency on Profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/chromeos/policy/user_cloud_external_data_manager_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/policy/user_cloud_external_data_manager_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698