Chromium Code Reviews| Index: ash/system/user/user_view.cc |
| diff --git a/ash/system/user/user_view.cc b/ash/system/user/user_view.cc |
| index 52f128da1a52fd41b6430984cfed08dbb0682306..04d758b4f4026a06d5813f244343e566c6466336 100644 |
| --- a/ash/system/user/user_view.cc |
| +++ b/ash/system/user/user_view.cc |
| @@ -499,9 +499,13 @@ void UserView::ToggleAddUserMenuOption() { |
| bool multi_profile_allowed = |
| delegate->IsMultiProfileAllowedByPrimaryUserPolicy(); |
| - add_user_disabled_ = (delegate->NumberOfLoggedInUsers() >= |
| - delegate->GetMaximumNumberOfLoggedInUsers()) || |
| - !multi_profile_allowed; |
| + int admitted_users_to_be_added = |
| + delegate->GetNumberOfUsersAdmittedForMultiProfile(); |
| + DCHECK(admitted_users_to_be_added >= 0); |
| + add_user_disabled_ = !multi_profile_allowed || |
|
James Cook
2014/09/22 19:52:23
Please change this to add_user_enabled_ and invert
Roman Sorokin (ftl)
2014/09/23 15:42:37
Done.
|
| + admitted_users_to_be_added == 0 || |
| + (delegate->NumberOfLoggedInUsers() >= |
| + delegate->GetMaximumNumberOfLoggedInUsers()); |
|
James Cook
2014/09/22 19:52:23
Given that all the data to decide whether or not a
Roman Sorokin (ftl)
2014/09/23 15:42:37
Done.
|
| ButtonFromView* button = new ButtonFromView( |
| add_user_view, |
| @@ -519,6 +523,8 @@ void UserView::ToggleAddUserMenuOption() { |
| int message_id; |
| if (!multi_profile_allowed) |
| message_id = IDS_ASH_STATUS_TRAY_MESSAGE_NOT_ALLOWED_PRIMARY_USER; |
| + else if (admitted_users_to_be_added == 0) |
| + message_id = IDS_ASH_STATUS_TRAY_MESSAGE_OUT_OF_USERS; |
| else |
| message_id = IDS_ASH_STATUS_TRAY_MESSAGE_CANNOT_ADD_USER; |