Chromium Code Reviews| Index: chrome/browser/ui/webui/signin/user_manager_screen_handler.cc |
| diff --git a/chrome/browser/ui/webui/signin/user_manager_screen_handler.cc b/chrome/browser/ui/webui/signin/user_manager_screen_handler.cc |
| index 22351cfc465d5502a82e3a371a188675607530af..a6550f27c50abd1c636bbb8d15053b2d86d1c222 100644 |
| --- a/chrome/browser/ui/webui/signin/user_manager_screen_handler.cc |
| +++ b/chrome/browser/ui/webui/signin/user_manager_screen_handler.cc |
| @@ -43,6 +43,8 @@ |
| #include "chrome/browser/ui/singleton_tabs.h" |
| #include "chrome/browser/ui/user_manager.h" |
| #include "chrome/browser/ui/webui/profile_helper.h" |
| +#include "chrome/browser/ui/webui/signin/login_ui_service.h" |
| +#include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" |
| #include "chrome/common/chrome_features.h" |
| #include "chrome/common/pref_names.h" |
| #include "chrome/common/url_constants.h" |
| @@ -464,6 +466,18 @@ void UserManagerScreenHandler::HandleAuthenticatedLaunchUser( |
| // password token, the user must perform a full online reauth. |
| UserManager::ShowReauthDialog(browser_context, email_address_, |
| signin_metrics::Reason::REASON_UNLOCK); |
| + } else if (entry->IsSigninRequired() && entry->IsSupervised()) { |
| + // Supervised profile will only be locked when force-sign-in is enabled |
| + // and it shouldn't be unlocked. Display the error message directly via |
| + // the system profile to avoid profile creation. |
| + LoginUIServiceFactory::GetForProfile( |
| + Profile::FromWebUI(web_ui())->GetOriginalProfile()) |
| + ->DisplayLoginResult(nullptr, |
| + l10n_util::GetStringUTF16( |
| + IDS_SUPERVISED_USER_NOT_ALLOWED_BY_POLICY), |
| + base::string16()); |
| + UserManager::ShowSigninDialog(browser_context, profile_path); |
|
anthonyvd
2016/12/05 18:56:37
Why is this showing the reauth dialog before showi
zmin
2016/12/08 20:42:43
Replace it with ShowDialogAndDisplayErrorMessage()
|
| + UserManager::DisplayErrorMessage(); |
| } else { |
| // Fresh sign in via user manager without existing email address. |
| UserManager::ShowSigninDialog(browser_context, profile_path); |