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

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: Fixed initialization 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
« no previous file with comments | « ash/session/session_state_delegate.h ('k') | ash/system/user/user_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..96f91934035aadf71586c893c792bcd8688985e2 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::AddUserError* error) const {
+ if (!IsMultiProfileAllowedByPrimaryUserPolicy()) {
+ if (error)
+ *error = ADD_USER_ERROR_NOT_ALLOWED_PRIMARY_USER;
+ return false;
+ }
+ if (NumberOfLoggedInUsers() >= GetMaximumNumberOfLoggedInUsers()) {
+ if (error)
+ *error = ADD_USER_ERROR_MAXIMUM_USERS_REACHED;
+ return false;
+ }
+ return true;
+}
+
} // namespace ash
« no previous file with comments | « ash/session/session_state_delegate.h ('k') | ash/system/user/user_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698