Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | |
michael@0 | 6 | #include "nsISupports.idl" |
michael@0 | 7 | |
michael@0 | 8 | interface nsILoginInfo; |
michael@0 | 9 | interface nsIDOMWindow; |
michael@0 | 10 | |
michael@0 | 11 | [scriptable, uuid(68b3cb59-51b8-4c57-bd7f-b2ce955a593d)] |
michael@0 | 12 | |
michael@0 | 13 | interface nsILoginManagerPrompter : nsISupports { |
michael@0 | 14 | /** |
michael@0 | 15 | * Initialize the prompter. Must be called before using other interfaces. |
michael@0 | 16 | * |
michael@0 | 17 | * @param aWindow |
michael@0 | 18 | * The in which the user is doing some login-related action that's |
michael@0 | 19 | * resulting in a need to prompt them for something. The prompt |
michael@0 | 20 | * will be associated with this window (or, if a notification bar |
michael@0 | 21 | * is being used, topmost opener in some cases). |
michael@0 | 22 | */ |
michael@0 | 23 | void init(in nsIDOMWindow aWindow); |
michael@0 | 24 | |
michael@0 | 25 | /** |
michael@0 | 26 | * Ask the user if they want to save a login (Yes, Never, Not Now) |
michael@0 | 27 | * |
michael@0 | 28 | * @param aLogin |
michael@0 | 29 | * The login to be saved. |
michael@0 | 30 | */ |
michael@0 | 31 | void promptToSavePassword(in nsILoginInfo aLogin); |
michael@0 | 32 | |
michael@0 | 33 | /** |
michael@0 | 34 | * Ask the user if they want to change a login's password. If the |
michael@0 | 35 | * user consents, modifyLogin() will be called. |
michael@0 | 36 | * |
michael@0 | 37 | * @param aOldLogin |
michael@0 | 38 | * The existing login (with the old password). |
michael@0 | 39 | * @param aNewLogin |
michael@0 | 40 | * The new login. |
michael@0 | 41 | */ |
michael@0 | 42 | void promptToChangePassword(in nsILoginInfo aOldLogin, |
michael@0 | 43 | in nsILoginInfo aNewLogin); |
michael@0 | 44 | |
michael@0 | 45 | /** |
michael@0 | 46 | * Ask the user if they want to change the password for one of |
michael@0 | 47 | * multiple logins, when the caller can't determine exactly which |
michael@0 | 48 | * login should be changed. If the user consents, modifyLogin() will |
michael@0 | 49 | * be called. |
michael@0 | 50 | * |
michael@0 | 51 | * @param logins |
michael@0 | 52 | * An array of existing logins. |
michael@0 | 53 | * @param count |
michael@0 | 54 | * (length of the array) |
michael@0 | 55 | * @param aNewLogin |
michael@0 | 56 | * The new login. |
michael@0 | 57 | * |
michael@0 | 58 | * Note: Because the caller does not know the username of the login |
michael@0 | 59 | * to be changed, aNewLogin.username and aNewLogin.usernameField |
michael@0 | 60 | * will be set (using the user's selection) before modifyLogin() |
michael@0 | 61 | * is called. |
michael@0 | 62 | */ |
michael@0 | 63 | void promptToChangePasswordWithUsernames( |
michael@0 | 64 | [array, size_is(count)] in nsILoginInfo logins, |
michael@0 | 65 | in uint32_t count, |
michael@0 | 66 | in nsILoginInfo aNewLogin); |
michael@0 | 67 | }; |
michael@0 | 68 | %{C++ |
michael@0 | 69 | |
michael@0 | 70 | #define NS_LOGINMANAGERPROMPTER_CONTRACTID "@mozilla.org/login-manager/prompter/;1" |
michael@0 | 71 | |
michael@0 | 72 | %} |