This is the meat of the chooser's logic. Differential Revision: https://phabricator.services.mozilla.com/D215008
41 lines
1.6 KiB
Plaintext
41 lines
1.6 KiB
Plaintext
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
webidl BrowsingContext;
|
|
webidl CredentialChooserOption;
|
|
|
|
interface mozIDOMWindow;
|
|
interface nsICredentialChosenCallback;
|
|
interface nsIURI;
|
|
|
|
[scriptable, uuid(673ddc19-03e2-4b30-a868-06297e8fed89)]
|
|
interface nsICredentialChooserService : nsISupports {
|
|
/**
|
|
* Show UI to allow the user to make a choice between credentials
|
|
*
|
|
* @param browsingContext The top-level browsing context of the context requesting a credential.
|
|
* @param credentials The options the user should choose from
|
|
* @param callback A callback to notify when the user makes a choice
|
|
*/
|
|
void showCredentialChooser(in BrowsingContext browsingContext, in Array<jsval> credentials, in nsICredentialChosenCallback callback);
|
|
/**
|
|
* Dismiss the credential chooser UI
|
|
*
|
|
* @param browsingContext The top-level browsing context of the context requesting a credential.
|
|
*/
|
|
void cancelCredentialChooser(in BrowsingContext browsingContext);
|
|
|
|
/**
|
|
* A service function to help any UI. Fetches and serializes images to
|
|
* data urls, which can be used in chrome UI.
|
|
*
|
|
* @param window Window which should perform the fetch
|
|
* @param uri Icon location to be fetched from
|
|
* @returns A promise resolving with the data URI encoded as a string representing the icon that was loaded
|
|
*/
|
|
Promise fetchImageToDataURI(in mozIDOMWindow window, in nsIURI uri);
|
|
};
|