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

Unified Diff: ash/session/session_state_delegate.cc

Issue 560033002: Fixed suggesting adding more users into multi-profile session when we don't have more (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update after review Created 6 years, 3 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/session/session_state_delegate.cc
diff --git a/ash/session/session_state_delegate.cc b/ash/session/session_state_delegate.cc
index e55a5adf55e794ed87f55150b4704d43b1e40887..787b54f586b2cbebed42a0d79550f962f7daf728 100644
--- a/ash/session/session_state_delegate.cc
+++ b/ash/session/session_state_delegate.cc
@@ -11,4 +11,19 @@ bool SessionStateDelegate::IsInSecondaryLoginScreen() const {
ash::SessionStateDelegate::SESSION_STATE_LOGIN_SECONDARY;
}
+bool SessionStateDelegate::CanAddUserToMultiProfile(
+ SessionStateDelegate::MultiProfileAddUserError* error) const {
+ if (!IsMultiProfileAllowedByPrimaryUserPolicy()) {
+ if (error)
+ *error = MULTIPROFILE_ADD_USER_ERROR_NOT_ALLOWED_PRIMARY_USER;
+ return false;
+ }
+ if (NumberOfLoggedInUsers() >= GetMaximumNumberOfLoggedInUsers()) {
+ if (error)
+ *error = MULTIPROFILE_ADD_USER_ERROR_MAXIMUM_OF_USERS_REACHED;
+ return false;
+ }
+ return true;
+}
+
} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698