| // Copyright 2019 The Chromium Authors |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| // Use the <code>chrome.loginState</code> API to read and monitor the login |
| // state. |
| [platforms=("chromeos", "lacros"), |
| implemented_in="chrome/browser/chromeos/extensions/login_screen/login_state/login_state_api.h"] |
| namespace loginState { |
| enum ProfileType { |
| // Specifies that the extension is in the signin profile. |
| SIGNIN_PROFILE, |
| |
| // Specifies that the extension is in the user profile. |
| USER_PROFILE |
| }; |
| |
| enum SessionState { |
| // Specifies that the session state is unknown. |
| UNKNOWN, |
| |
| // Specifies that the user is in the out-of-box-experience screen. |
| IN_OOBE_SCREEN, |
| |
| // Specifies that the user is in the login screen. |
| IN_LOGIN_SCREEN, |
| |
| // Specifies that the user is in the session. |
| IN_SESSION, |
| |
| // Specifies that the user is in the lock screen. |
| IN_LOCK_SCREEN, |
| |
| // Specifies that the device is in RMA mode, finalizing repairs. |
| IN_RMA_SCREEN |
| }; |
| |
| callback ProfileTypeCallback = void (ProfileType result); |
| callback SessionStateCallback = void (SessionState result); |
| |
| interface Functions { |
| // Gets the type of the profile the extension is in. |
| [supportsPromises] static void getProfileType(ProfileTypeCallback callback); |
| |
| // Gets the current session state. |
| [supportsPromises] static void getSessionState( |
| SessionStateCallback callback); |
| }; |
| |
| interface Events { |
| // Dispatched when the session state changes. <code>sessionState</code> |
| // is the new session state. |
| static void onSessionStateChanged(SessionState sessionState); |
| }; |
| }; |