session_manager_types.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. // Copyright 2016 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef COMPONENTS_SESSION_MANAGER_SESSION_MANAGER_TYPES_H_
  5. #define COMPONENTS_SESSION_MANAGER_SESSION_MANAGER_TYPES_H_
  6. #include "components/account_id/account_id.h"
  7. namespace session_manager {
  8. // TODO(xiyuan): Get rid/consolidate with chromeos::LoggedInState.
  9. enum class SessionState {
  10. // Default value, when session state hasn't been initialized yet.
  11. UNKNOWN = 0,
  12. // Running out of box UI.
  13. OOBE,
  14. // Running login UI (primary user), including the post login steps such as
  15. // selecting avatar, agreeing to terms of service etc.
  16. LOGIN_PRIMARY,
  17. // A transient state between LOGIN_PRIMARY/LOGIN_SECONDARY and ACTIVE to
  18. // prepare user desktop environment (e.g. launching browser windows) while the
  19. // login screen is still visible. Should only be set from OOBE,
  20. // LOGIN_PRIMARY, or LOGIN_SECONDARY.
  21. LOGGED_IN_NOT_ACTIVE,
  22. // A user(s) has logged in *and* login UI is hidden i.e. user session is
  23. // not blocked.
  24. ACTIVE,
  25. // The session screen is locked.
  26. LOCKED,
  27. // Same as LOGIN_PRIMARY but for multi-profiles sign in i.e. when there's at
  28. // least one user already active in the session.
  29. LOGIN_SECONDARY,
  30. // Device is being repaired and the RMA app is active.
  31. RMA,
  32. };
  33. // A type for session id.
  34. using SessionId = int;
  35. // Info about a user session.
  36. struct Session {
  37. SessionId id;
  38. AccountId user_account_id;
  39. };
  40. // Limits the number of logged in users to 5. User-switcher UI was not designed
  41. // around a large number of users. This also helps on memory-constrained
  42. // devices. See b/64593342 for some additional context.
  43. constexpr int kMaximumNumberOfUserSessions = 5;
  44. } // namespace session_manager
  45. #endif // COMPONENTS_SESSION_MANAGER_SESSION_MANAGER_TYPES_H_