Source code

Revision control

Other Tools

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/. */
4
5
6
#include "nsISupports.idl"
7
8
interface nsILoginInfo;
9
interface nsIDOMWindow;
10
11
webidl Element;
12
13
[scriptable, uuid(c47ff942-9678-44a5-bc9b-05e0d676c79c)]
14
interface nsILoginManagerPrompter : nsISupports {
15
16
/**
17
* Ask the user if they want to save a login (Yes, Never, Not Now)
18
*
19
* @param aBrowser
20
* The browser of the webpage request that triggered the prompt.
21
* @param aLogin
22
* The login to be saved.
23
* @param dismissed
24
* A boolean value indicating whether the save logins doorhanger should
25
* be dismissed automatically when shown.
26
* @param notifySaved
27
* A boolean value indicating whether the notification should indicate that
28
* a login has been saved
29
* @param autoFilledLoginGuid
30
* A string guid value for the login which was autofilled into the form
31
*/
32
void promptToSavePassword(in Element aBrowser,
33
in nsILoginInfo aLogin,
34
[optional] in boolean dismissed,
35
[optional] in boolean notifySaved,
36
[optional] in AString autoFilledLoginGuid);
37
38
/**
39
* Ask the user if they want to change a login's password or username.
40
* If the user consents, modifyLogin() will be called.
41
*
42
* @param aBrowser
43
* The browser of the webpage request that triggered the prompt.
44
* @param aOldLogin
45
* The existing login (with the old password).
46
* @param aNewLogin
47
* The new login.
48
* @param dismissed
49
* A boolean value indicating whether the save logins doorhanger should
50
* be dismissed automatically when shown.
51
* @param autoSavedLoginGuid
52
* A string guid value for the old login to be removed if the changes
53
* match it to a different login
54
* @param autoFilledLoginGuid
55
* A string guid value for the login which was autofilled into the form
56
*/
57
void promptToChangePassword(in Element aBrowser,
58
in nsILoginInfo aOldLogin,
59
in nsILoginInfo aNewLogin,
60
[optional] in boolean dismissed,
61
[optional] in boolean notifySaved,
62
[optional] in AString autoSavedLoginGuid,
63
[optional] in AString autoFilledLoginGuid);
64
65
/**
66
* Ask the user if they want to change the password for one of
67
* multiple logins, when the caller can't determine exactly which
68
* login should be changed. If the user consents, modifyLogin() will
69
* be called.
70
*
71
* @param aBrowser
72
* The browser of the webpage request that triggered the prompt.
73
* @param logins
74
* An array of existing logins.
75
* @param aNewLogin
76
* The new login.
77
*
78
* Note: Because the caller does not know the username of the login
79
* to be changed, aNewLogin.username and aNewLogin.usernameField
80
* will be set (using the user's selection) before modifyLogin()
81
* is called.
82
*/
83
void promptToChangePasswordWithUsernames(
84
in Element aBrowser,
85
in Array<nsILoginInfo> logins,
86
in nsILoginInfo aNewLogin);
87
};
88
%{C++
89
90
#define NS_LOGINMANAGERPROMPTER_CONTRACTID "@mozilla.org/login-manager/prompter/;1"
91
92
%}