Backed out changeset b06f19b95b94 (bug 1784438) for causing build bustages CLOSED...
[gecko.git] / toolkit / components / credentialmanagement / nsICredentialChooserService.idl
blobcd9401ebab8590aec71f536624fc73e8cc2b90d7
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #include "nsISupports.idl"
7 webidl BrowsingContext;
8 webidl CredentialChooserOption;
10 interface mozIDOMWindow;
11 interface nsICredentialChosenCallback;
12 interface nsIURI;
14 [scriptable, uuid(673ddc19-03e2-4b30-a868-06297e8fed89)]
15 interface nsICredentialChooserService : nsISupports {
16 /**
17 * Show UI to allow the user to make a choice between credentials
19 * @param browsingContext The top-level browsing context of the context requesting a credential.
20 * @param credentials The options the user should choose from
21 * @param callback A callback to notify when the user makes a choice
23 void showCredentialChooser(in BrowsingContext browsingContext, in Array<jsval> credentials, in nsICredentialChosenCallback callback);
24 /**
25 * Dismiss the credential chooser UI
27 * @param browsingContext The top-level browsing context of the context requesting a credential.
29 void cancelCredentialChooser(in BrowsingContext browsingContext);
31 /**
32 * A service function to help any UI. Fetches and serializes images to
33 * data urls, which can be used in chrome UI.
35 * @param window Window which should perform the fetch
36 * @param uri Icon location to be fetched from
37 * @returns A promise resolving with the data URI encoded as a string representing the icon that was loaded
39 Promise fetchImageToDataURI(in mozIDOMWindow window, in nsIURI uri);