toolkit/components/passwordmgr/nsILoginManagerPrompter.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/toolkit/components/passwordmgr/nsILoginManagerPrompter.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,72 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.7 +
     1.8 +
     1.9 +#include "nsISupports.idl"
    1.10 +
    1.11 +interface nsILoginInfo;
    1.12 +interface nsIDOMWindow;
    1.13 +
    1.14 +[scriptable, uuid(68b3cb59-51b8-4c57-bd7f-b2ce955a593d)]
    1.15 +
    1.16 +interface nsILoginManagerPrompter : nsISupports {
    1.17 +    /**
    1.18 +     * Initialize the prompter. Must be called before using other interfaces.
    1.19 +     *
    1.20 +     * @param aWindow
    1.21 +     *        The in which the user is doing some login-related action that's
    1.22 +     *        resulting in a need to prompt them for something. The prompt
    1.23 +     *        will be associated with this window (or, if a notification bar
    1.24 +     *        is being used, topmost opener in some cases).
    1.25 +     */
    1.26 +    void init(in nsIDOMWindow aWindow);
    1.27 +
    1.28 +    /**
    1.29 +     * Ask the user if they want to save a login (Yes, Never, Not Now)
    1.30 +     *
    1.31 +     * @param aLogin
    1.32 +     *        The login to be saved.
    1.33 +     */
    1.34 +    void promptToSavePassword(in nsILoginInfo aLogin);
    1.35 +
    1.36 +    /**
    1.37 +     * Ask the user if they want to change a login's password. If the
    1.38 +     * user consents, modifyLogin() will be called.
    1.39 +     *
    1.40 +     * @param aOldLogin
    1.41 +     *        The existing login (with the old password).
    1.42 +     * @param aNewLogin
    1.43 +     *        The new login.
    1.44 +     */
    1.45 +    void promptToChangePassword(in nsILoginInfo aOldLogin,
    1.46 +                                in nsILoginInfo aNewLogin);
    1.47 +
    1.48 +    /**
    1.49 +     * Ask the user if they want to change the password for one of
    1.50 +     * multiple logins, when the caller can't determine exactly which
    1.51 +     * login should be changed. If the user consents, modifyLogin() will
    1.52 +     * be called.
    1.53 +     *
    1.54 +     * @param logins
    1.55 +     *        An array of existing logins.
    1.56 +     * @param count
    1.57 +     *        (length of the array)
    1.58 +     * @param aNewLogin
    1.59 +     *        The new login.
    1.60 +     *
    1.61 +     * Note: Because the caller does not know the username of the login
    1.62 +     *       to be changed, aNewLogin.username and aNewLogin.usernameField
    1.63 +     *       will be set (using the user's selection) before modifyLogin()
    1.64 +     *       is called.
    1.65 +     */
    1.66 +    void promptToChangePasswordWithUsernames(
    1.67 +            [array, size_is(count)] in nsILoginInfo logins,
    1.68 +            in uint32_t count,
    1.69 +            in nsILoginInfo aNewLogin);
    1.70 +};
    1.71 +%{C++
    1.72 +
    1.73 +#define NS_LOGINMANAGERPROMPTER_CONTRACTID "@mozilla.org/login-manager/prompter/;1"
    1.74 +
    1.75 +%}

mercurial