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

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
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,

Powered by Google App Engine
This is Rietveld 408576698