blob: ff16520d59d60fb1893d3d1c117524a468664e1a [file] [log] [blame]
// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
module crosapi.mojom;
[Stable, Extensible]
enum SessionState {
[Default] kUnknown = 0,
kInOobeScreen,
kInLoginScreen,
kInSession,
kInLockScreen,
[MinVersion=1] kInRmaScreen,
};
[Stable]
union GetSessionStateResult {
// Implies failure.
string error_message;
// Implies success.
SessionState session_state;
};
// Interface for observers of session state changes.
[Stable, Uuid="01078da6-3eaf-46fe-af13-30dde5f24b55"]
interface SessionStateChangedEventObserver {
// Called when the mapped session state changes.
OnSessionStateChanged@0(SessionState session_state);
};
// This API allows Lacros to query the current login state.
[Stable, Uuid="3bb04a21-64f1-46b6-9f6e-f71fc950a9dc"]
interface LoginState {
// Adds an observer for session state changes.
AddObserver@0(pending_remote<SessionStateChangedEventObserver> observer);
// Returns the current session state.
GetSessionState@1() => (GetSessionStateResult result);
};