diff options
author | rsorokin@chromium.org <rsorokin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-13 16:04:04 +0000 |
---|---|---|
committer | rsorokin@chromium.org <rsorokin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-13 16:05:23 +0000 |
commit | 815dfac97145b951ffd8c179d56f025371c8edd2 (patch) | |
tree | 527bcfdecfa76582c974b803631043f877ab0b63 /ash/system/user | |
parent | bcd365e5495e53cc5e512fbc1fe87119af30e8e6 (diff) | |
download | chromium_src-815dfac97145b951ffd8c179d56f025371c8edd2.zip chromium_src-815dfac97145b951ffd8c179d56f025371c8edd2.tar.gz chromium_src-815dfac97145b951ffd8c179d56f025371c8edd2.tar.bz2 |
Providing more information on why certain users can't be added to multi-profile
session
BUG=388279
Review URL: https://codereview.chromium.org/374853002
Cr-Commit-Position: refs/heads/master@{#289304}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@289304 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/system/user')
-rw-r--r-- | ash/system/user/user_view.cc | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/ash/system/user/user_view.cc b/ash/system/user/user_view.cc index f3646a7..689764f 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 multi_profile_allowed = + delegate->IsMultiProfileAllowedByPrimaryUserPolicy(); + add_user_disabled_ = (delegate->NumberOfLoggedInUsers() >= + delegate->GetMaximumNumberOfLoggedInUsers()) || + !multi_profile_allowed; + 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 message_id; + if (!multi_profile_allowed) + message_id = IDS_ASH_STATUS_TRAY_MESSAGE_NOT_ALLOWED_PRIMARY_USER; + else + message_id = 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(message_id), PopupMessage::ICON_WARNING, add_user_view->anchor(), views::BubbleBorder::TOP_LEFT, |