OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // Use the <code>chrome.passwordsPrivate</code> API to add or remove password |
| 6 // data from the settings UI. |
| 7 namespace passwordsPrivate { |
| 8 // Pair of origin URL and login saved for that URL. |
| 9 dictionary LoginPair { |
| 10 // The human-readable origin for the URL where the password is used. |
| 11 DOMString originUrl; |
| 12 |
| 13 // The username used in conjunction with the saved password. |
| 14 DOMString username; |
| 15 }; |
| 16 |
| 17 // Entry used to display a password in the settings UI. |
| 18 dictionary PasswordUiEntry { |
| 19 // The login information for this entry. |
| 20 LoginPair loginPair; |
| 21 |
| 22 // The number of characters in the password; used to display placeholder |
| 23 // dots in the UI. |
| 24 long numCharactersInPassword; |
| 25 |
| 26 // Text shown if the password was obtained via a federated identity. |
| 27 DOMString? federationText; |
| 28 }; |
| 29 |
| 30 callback CanAccountBeManagedCallback = void(boolean canAccountBeManaged); |
| 31 callback PlaintextPasswordCallback = void(DOMString plaintextPassword); |
| 32 |
| 33 interface Functions { |
| 34 // Determines whether account's passwords can be managed via |
| 35 // https://passwords.google.com/settings/passwords. |
| 36 // |
| 37 // |callback|: Callback which will be passed the boolean of whether the |
| 38 // account can be managed. |
| 39 static void canPasswordAccountBeManaged( |
| 40 CanAccountBeManagedCallback callback); |
| 41 |
| 42 // Removes the saved password corresponding to |loginPair|. If no saved |
| 43 // password for this pair exists, this function is a no-op. |
| 44 // |
| 45 // |loginPair|: The LoginPair corresponding to the entry to remove. |
| 46 static void removeSavedPassword(LoginPair loginPair); |
| 47 |
| 48 // Removes the saved password exception corresponding to |exceptionUrl|. If |
| 49 // no exception with this URL exists, this function is a no-op. |
| 50 // |
| 51 // |exceptionUrl|: The URL corresponding to the exception to remove. |
| 52 static void removePasswordException(DOMString exceptionUrl); |
| 53 |
| 54 // Returns the plaintext password corresponding to |loginPair|. Note that on |
| 55 // some operating systems, this call may result in an OS-level |
| 56 // reauthentication. |
| 57 // |
| 58 // |loginPair|: The LoginPair corresponding to the entry whose password |
| 59 // is to be returned. |
| 60 // |callback|: Callback which will be passed the plaintext password. |
| 61 static void getPlaintextPassword( |
| 62 LoginPair loginPair, PlaintextPasswordCallback callback); |
| 63 }; |
| 64 |
| 65 interface Events { |
| 66 // Fired when the saved passwords list has changed, meaning that an entry |
| 67 // has been added or removed. Note that this event fires as soon as a |
| 68 // listener is added. |
| 69 // |
| 70 // |entries|: The updated list of password entries. |
| 71 static void onSavedPasswordsListChanged(PasswordUiEntry[] entries); |
| 72 |
| 73 // Fired when the password exceptions list has changed, meaning that an |
| 74 // entry has been added or removed. Note that this event fires as soon as a |
| 75 // listener is added. |
| 76 // |
| 77 // |exceptions|: The updated list of password exceptions. |
| 78 static void onPasswordExceptionsListChanged(DOMString[] exceptions); |
| 79 }; |
| 80 }; |
OLD | NEW |