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 f3646a7a7aa3ca238418c8b359c03101a1c49cd0..7c4720422d8072491469e8478a48063d690c2f51 100644 |
| --- a/ash/system/user/user_view.cc |
| +++ b/ash/system/user/user_view.cc |
| @@ -493,8 +493,13 @@ void UserView::ToggleAddUserMenuOption() { |
| const SessionStateDelegate* delegate = |
| Shell::GetInstance()->session_state_delegate(); |
| - add_user_disabled_ = delegate->NumberOfLoggedInUsers() >= |
| - delegate->GetMaximumNumberOfLoggedInUsers(); |
| + |
| + bool IsMultiProfileAllowed = |
|
James Cook
2014/08/11 17:01:34
is_multi_profile_allowed (or just multi_profile_al
Roman Sorokin (ftl)
2014/08/11 17:41:45
Done.
|
| + delegate->IsMultiProfileAllowedByPrimaryUserPolicy(); |
| + add_user_disabled_ = (delegate->NumberOfLoggedInUsers() >= |
| + delegate->GetMaximumNumberOfLoggedInUsers()) || |
| + !IsMultiProfileAllowed; |
| + |
| ButtonFromView* button = new ButtonFromView( |
| add_user_view, |
| add_user_disabled_ ? NULL : this, |
| @@ -508,9 +513,15 @@ void UserView::ToggleAddUserMenuOption() { |
| if (add_user_disabled_) { |
| ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); |
| + int messageId; |
|
James Cook
2014/08/11 17:01:34
message_id
Roman Sorokin (ftl)
2014/08/11 17:41:44
Done.
|
| + if (!IsMultiProfileAllowed) |
| + messageId = IDS_ASH_STATUS_TRAY_MESSAGE_NOT_ALLOWED_PRIMARY_USER; |
| + else |
| + messageId = IDS_ASH_STATUS_TRAY_MESSAGE_CANNOT_ADD_USER; |
| + |
| popup_message_.reset(new PopupMessage( |
| bundle.GetLocalizedString(IDS_ASH_STATUS_TRAY_CAPTION_CANNOT_ADD_USER), |
| - bundle.GetLocalizedString(IDS_ASH_STATUS_TRAY_MESSAGE_CANNOT_ADD_USER), |
| + bundle.GetLocalizedString(messageId), |
| PopupMessage::ICON_WARNING, |
| add_user_view->anchor(), |
| views::BubbleBorder::TOP_LEFT, |