| 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/ui/webui/chromeos/login/gaia_screen_handler.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 bool supervised_users_can_create = true; | 68 bool supervised_users_can_create = true; |
| 69 int message_id = -1; | 69 int message_id = -1; |
| 70 if (!has_users) { | 70 if (!has_users) { |
| 71 supervised_users_can_create = false; | 71 supervised_users_can_create = false; |
| 72 message_id = IDS_CREATE_SUPERVISED_USER_NO_MANAGER_TEXT; | 72 message_id = IDS_CREATE_SUPERVISED_USER_NO_MANAGER_TEXT; |
| 73 } | 73 } |
| 74 if (!allow_new_user || !supervised_users_allowed) { | 74 if (!allow_new_user || !supervised_users_allowed) { |
| 75 supervised_users_can_create = false; | 75 supervised_users_can_create = false; |
| 76 message_id = IDS_CREATE_SUPERVISED_USER_CREATION_RESTRICTED_TEXT; | 76 message_id = IDS_CREATE_SUPERVISED_USER_CREATION_RESTRICTED_TEXT; |
| 77 } | 77 } |
| 78 if (supervised_users_can_create && |
| 79 user_manager::UserManager::Get() |
| 80 ->GetUsersAllowedForSupervisedUsersCreation() |
| 81 .empty()) { |
| 82 supervised_users_can_create = false; |
| 83 message_id = IDS_CREATE_SUPERVISED_USER_NO_MANAGER_EXCEPT_SUPERVISED_TEXT; |
| 84 } |
| 78 | 85 |
| 79 params->SetBoolean("supervisedUsersEnabled", supervised_users_allowed); | 86 params->SetBoolean("supervisedUsersEnabled", supervised_users_allowed); |
| 80 params->SetBoolean("supervisedUsersCanCreate", supervised_users_can_create); | 87 params->SetBoolean("supervisedUsersCanCreate", supervised_users_can_create); |
| 81 if (!supervised_users_can_create) { | 88 if (!supervised_users_can_create) { |
| 82 params->SetString("supervisedUsersRestrictionReason", | 89 params->SetString("supervisedUsersRestrictionReason", |
| 83 l10n_util::GetStringUTF16(message_id)); | 90 l10n_util::GetStringUTF16(message_id)); |
| 84 } | 91 } |
| 85 | 92 |
| 86 // Now check whether we're in multi-profiles user adding scenario and | 93 // Now check whether we're in multi-profiles user adding scenario and |
| 87 // disable GAIA right panel features if that's the case. | 94 // disable GAIA right panel features if that's the case. |
| (...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 729 | 736 |
| 730 SigninScreenHandlerDelegate* GaiaScreenHandler::Delegate() { | 737 SigninScreenHandlerDelegate* GaiaScreenHandler::Delegate() { |
| 731 DCHECK(signin_screen_handler_); | 738 DCHECK(signin_screen_handler_); |
| 732 return signin_screen_handler_->delegate_; | 739 return signin_screen_handler_->delegate_; |
| 733 } | 740 } |
| 734 | 741 |
| 735 void GaiaScreenHandler::SetSigninScreenHandler(SigninScreenHandler* handler) { | 742 void GaiaScreenHandler::SetSigninScreenHandler(SigninScreenHandler* handler) { |
| 736 signin_screen_handler_ = handler; | 743 signin_screen_handler_ = handler; |
| 737 } | 744 } |
| 738 } // namespace chromeos | 745 } // namespace chromeos |
| OLD | NEW |