Fix broken path in extensions/common/PRESUBMIT.py
[chromium-blink-merge.git] / chrome / common / extensions / api / passwords_private.idl
blob7dea8b9e6a336bb3f367348ad0a86a6870938490
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.
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;
13 // The username used in conjunction with the saved password.
14 DOMString username;
17 // Entry used to display a password in the settings UI.
18 dictionary PasswordUiEntry {
19 // The login information for this entry.
20 LoginPair loginPair;
22 // The number of characters in the password; used to display placeholder
23 // dots in the UI.
24 long numCharactersInPassword;
26 // Text shown if the password was obtained via a federated identity.
27 DOMString? federationText;
30 callback CanAccountBeManagedCallback = void(boolean canAccountBeManaged);
31 callback PlaintextPasswordCallback = void(DOMString plaintextPassword);
33 interface Functions {
34 // Determines whether account's passwords can be managed via
35 // https://passwords.google.com/settings/passwords.
37 // |callback|: Callback which will be passed the boolean of whether the
38 // account can be managed.
39 static void canPasswordAccountBeManaged(
40 CanAccountBeManagedCallback callback);
42 // Removes the saved password corresponding to |loginPair|. If no saved
43 // password for this pair exists, this function is a no-op.
45 // |loginPair|: The LoginPair corresponding to the entry to remove.
46 static void removeSavedPassword(LoginPair loginPair);
48 // Removes the saved password exception corresponding to |exceptionUrl|. If
49 // no exception with this URL exists, this function is a no-op.
51 // |exceptionUrl|: The URL corresponding to the exception to remove.
52 static void removePasswordException(DOMString exceptionUrl);
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.
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);
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.
70 // |entries|: The updated list of password entries.
71 static void onSavedPasswordsListChanged(PasswordUiEntry[] entries);
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.
77 // |exceptions|: The updated list of password exceptions.
78 static void onPasswordExceptionsListChanged(DOMString[] exceptions);