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

Side by Side Diff: chrome/browser/chromeos/login/users/chrome_user_manager_impl.cc

Issue 2599033002: Explicitly forbid multiprofiles on the Active Directory devices. (Closed)
Patch Set: Remove nullptr check Created 4 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/chromeos/login/users/chrome_user_manager_impl.h" 5 #include "chrome/browser/chromeos/login/users/chrome_user_manager_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <cstddef> 9 #include <cstddef>
10 #include <set> 10 #include <set>
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 } 291 }
292 292
293 user_manager::UserList ChromeUserManagerImpl::GetUsersAllowedForMultiProfile() 293 user_manager::UserList ChromeUserManagerImpl::GetUsersAllowedForMultiProfile()
294 const { 294 const {
295 // Supervised users are not allowed to use multi-profiles. 295 // Supervised users are not allowed to use multi-profiles.
296 if (GetLoggedInUsers().size() == 1 && 296 if (GetLoggedInUsers().size() == 1 &&
297 GetPrimaryUser()->GetType() != user_manager::USER_TYPE_REGULAR) { 297 GetPrimaryUser()->GetType() != user_manager::USER_TYPE_REGULAR) {
298 return user_manager::UserList(); 298 return user_manager::UserList();
299 } 299 }
300 300
301 // Multiprofiles are not allowed on the Active Directory managed devices.
Alexander Alekseev 2016/12/23 15:41:41 nit: "Multiprofile mode is not allowed..."
Roman Sorokin (ftl) 2016/12/23 16:06:38 Done.
302 policy::BrowserPolicyConnectorChromeOS* connector =
303 g_browser_process->platform_part()->browser_policy_connector_chromeos();
304 if (connector->IsActiveDirectoryManaged())
305 return user_manager::UserList();
306
301 user_manager::UserList result; 307 user_manager::UserList result;
302 const user_manager::UserList& users = GetUsers(); 308 const user_manager::UserList& users = GetUsers();
303 for (user_manager::UserList::const_iterator it = users.begin(); 309 for (user_manager::UserList::const_iterator it = users.begin();
304 it != users.end(); 310 it != users.end();
305 ++it) { 311 ++it) {
306 if ((*it)->GetType() == user_manager::USER_TYPE_REGULAR && 312 if ((*it)->GetType() == user_manager::USER_TYPE_REGULAR &&
307 !(*it)->is_logged_in()) { 313 !(*it)->is_logged_in()) {
308 MultiProfileUserController::UserAllowedInSessionReason check; 314 MultiProfileUserController::UserAllowedInSessionReason check;
309 multi_profile_user_controller_->IsUserAllowedInSession( 315 multi_profile_user_controller_->IsUserAllowedInSession(
310 (*it)->GetAccountId().GetUserEmail(), &check); 316 (*it)->GetAccountId().GetUserEmail(), &check);
(...skipping 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after
1357 break; 1363 break;
1358 default: 1364 default:
1359 NOTREACHED(); 1365 NOTREACHED();
1360 break; 1366 break;
1361 } 1367 }
1362 1368
1363 return user; 1369 return user;
1364 } 1370 }
1365 1371
1366 } // namespace chromeos 1372 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698