Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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. | |
| 302 policy::BrowserPolicyConnectorChromeOS* connector = | |
| 303 g_browser_process->platform_part()->browser_policy_connector_chromeos(); | |
| 304 if (connector && connector->IsActiveDirectoryManaged()) | |
|
Thiemo Nagel
2016/12/22 13:52:08
In which case could the connector be nullptr?
Roman Sorokin (ftl)
2016/12/22 13:56:05
I dunno. Probably never could.
Thiemo Nagel
2016/12/22 13:57:49
Then maybe we shouldn't check for it?
Roman Sorokin (ftl)
2016/12/22 14:13:03
Done.
| |
| 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 Loading... | |
| 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 |
| OLD | NEW |