| // 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.loginScreenStorage</code> API to store persistent data |
| // from the login screen or inject data into the session. |
| [platforms=("chromeos", "lacros"), |
| implemented_in="chrome/browser/chromeos/extensions/login_screen/login_screen_storage/login_screen_storage_api.h"] |
| namespace loginScreenStorage { |
| callback StoreCallback = void (); |
| callback RetrieveCallback = void (DOMString data); |
| |
| interface Functions { |
| // Stores persistent data from the login screen. This data can be accessed |
| // later using $(ref:retrievePersistentData) by any extension from the |
| // specified extension ids. This method will fail if called while a user |
| // session is active. |
| // |extensionIds|: IDs of the extensions that should have access to the |
| // stored data. |
| // |data|: The data to store. |
| [supportsPromises] static void storePersistentData(DOMString[] extensionIds, |
| DOMString data, |
| StoreCallback callback); |
| |
| // Retrieves persistent data that was previously stored using |
| // $(ref:storePersistentData) for the caller's extension ID. |
| // |ownerId|: ID of the extension that saved the data that the caller is |
| // trying to retrieve. |
| [supportsPromises] static void retrievePersistentData( |
| DOMString ownerId, |
| RetrieveCallback callback); |
| |
| // Stores credentials for later access from the user session. This method |
| // will fail if called while a user session is active. |
| // |extensionId|: ID of the in-session extension that should have access to |
| // these credentials. Credentials stored using this method are deleted on |
| // session exit. |
| // |credentials|: The credentials to store. |
| [supportsPromises] static void storeCredentials(DOMString extensionId, |
| DOMString credentials, |
| StoreCallback callback); |
| |
| // Retrieves credentials that were previosly stored using |
| // $(ref:storeCredentials). The caller's extension ID should be the same as |
| // the extension id passed to the $(ref:storeCredentials). |
| [supportsPromises] static void retrieveCredentials( |
| RetrieveCallback callback); |
| }; |
| }; |