Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2517)

Unified Diff: ash/system/user/user_view.cc

Issue 374853002: Providing more information on why certain users can't be added to multi-profile (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor fix Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/shell/shell_delegate_impl.cc ('k') | ash/test/test_session_state_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..689764fc5ffb6ab27d487fd3e674164279cd83dc 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,
« no previous file with comments | « ash/shell/shell_delegate_impl.cc ('k') | ash/test/test_session_state_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698