login_state.mojom 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // Copyright 2021 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. module crosapi.mojom;
  5. [Stable, Extensible]
  6. enum SessionState {
  7. [Default] kUnknown = 0,
  8. kInOobeScreen,
  9. kInLoginScreen,
  10. kInSession,
  11. kInLockScreen,
  12. [MinVersion=1] kInRmaScreen,
  13. };
  14. [Stable]
  15. union GetSessionStateResult {
  16. // Implies failure.
  17. string error_message;
  18. // Implies success.
  19. SessionState session_state;
  20. };
  21. // Interface for observers of session state changes.
  22. [Stable, Uuid="01078da6-3eaf-46fe-af13-30dde5f24b55"]
  23. interface SessionStateChangedEventObserver {
  24. // Called when the mapped session state changes.
  25. OnSessionStateChanged@0(SessionState session_state);
  26. };
  27. // This API allows Lacros to query the current login state.
  28. [Stable, Uuid="3bb04a21-64f1-46b6-9f6e-f71fc950a9dc"]
  29. interface LoginState {
  30. // Adds an observer for session state changes.
  31. AddObserver@0(pending_remote<SessionStateChangedEventObserver> observer);
  32. // Returns the current session state.
  33. GetSessionState@1() => (GetSessionStateResult result);
  34. };