Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(459)

Side by Side Diff: chrome/common/extensions/api/passwords_private.idl

Issue 1892613006: Add functions to the passwords private api that update the lists. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add callback Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Use the <code>chrome.passwordsPrivate</code> API to add or remove password 5 // Use the <code>chrome.passwordsPrivate</code> API to add or remove password
6 // data from the settings UI. 6 // data from the settings UI.
7 namespace passwordsPrivate { 7 namespace passwordsPrivate {
8 // Pair of origin URL and login saved for that URL. 8 // Pair of origin URL and login saved for that URL.
9 dictionary LoginPair { 9 dictionary LoginPair {
10 // The human-readable origin for the URL where the password is used. 10 // The human-readable origin for the URL where the password is used.
(...skipping 21 matching lines...) Expand all
32 32
33 // Dictionary passed to listeners for the onPlaintextPasswordRetrieved event. 33 // Dictionary passed to listeners for the onPlaintextPasswordRetrieved event.
34 dictionary PlaintextPasswordEventParameters { 34 dictionary PlaintextPasswordEventParameters {
35 // The LoginPair associated with the retrieved password. 35 // The LoginPair associated with the retrieved password.
36 LoginPair loginPair; 36 LoginPair loginPair;
37 37
38 // The password in plaintext. 38 // The password in plaintext.
39 DOMString plaintextPassword; 39 DOMString plaintextPassword;
40 }; 40 };
41 41
42 callback passwordListCallback = void(PasswordUiEntry[] entries);
43 callback exceptionListCallback = void(DOMString[] exceptions);
44
42 interface Functions { 45 interface Functions {
43 // Removes the saved password corresponding to |loginPair|. If no saved 46 // Removes the saved password corresponding to |loginPair|. If no saved
44 // password for this pair exists, this function is a no-op. 47 // password for this pair exists, this function is a no-op.
45 // 48 //
46 // |loginPair|: The LoginPair corresponding to the entry to remove. 49 // |loginPair|: The LoginPair corresponding to the entry to remove.
47 static void removeSavedPassword(LoginPair loginPair); 50 static void removeSavedPassword(LoginPair loginPair);
48 51
49 // Removes the saved password exception corresponding to |exceptionUrl|. If 52 // Removes the saved password exception corresponding to |exceptionUrl|. If
50 // no exception with this URL exists, this function is a no-op. 53 // no exception with this URL exists, this function is a no-op.
51 // 54 //
52 // |exceptionUrl|: The URL corresponding to the exception to remove. 55 // |exceptionUrl|: The URL corresponding to the exception to remove.
53 static void removePasswordException(DOMString exceptionUrl); 56 static void removePasswordException(DOMString exceptionUrl);
54 57
55 // Returns the plaintext password corresponding to |loginPair|. Note that on 58 // Returns the plaintext password corresponding to |loginPair|. Note that on
56 // some operating systems, this call may result in an OS-level 59 // some operating systems, this call may result in an OS-level
57 // reauthentication. Once the password has been fetched, it will be returned 60 // reauthentication. Once the password has been fetched, it will be returned
58 // via the onPlaintextPasswordRetrieved event. 61 // via the onPlaintextPasswordRetrieved event.
62 // TODO(hcarmona): Make this use a callback for consistency.
stevenjb 2016/04/19 20:59:17 This is a bit more complicated. I don't remember t
hcarmona 2016/04/19 23:07:45 Sounds good. I haven't investigated this yet, I no
59 // 63 //
60 // |loginPair|: The LoginPair corresponding to the entry whose password 64 // |loginPair|: The LoginPair corresponding to the entry whose password
61 // is to be returned. 65 // is to be returned.
62 static void requestPlaintextPassword(LoginPair loginPair); 66 static void requestPlaintextPassword(LoginPair loginPair);
67
68 // Returns the list of saved passwords using |callback|.
69 //
70 // |callback|: Called with the list of saved passwords.
71 static void requestSavedPasswordList(passwordListCallback callback);
stevenjb 2016/04/19 20:59:17 I think these should now be 'get' instead of 'requ
hcarmona 2016/04/19 23:07:45 Done.
72
73 // Returns the list of password exceptions using |callback|.
74 //
75 // |callback|: Called with the list of password exceptions.
76 static void requestPasswordExceptionList(exceptionListCallback callback);
63 }; 77 };
64 78
65 interface Events { 79 interface Events {
66 // Fired when the saved passwords list has changed, meaning that an entry 80 // 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 81 // has been added or removed. Note that this event fires as soon as a
68 // listener is added. 82 // listener is added.
69 // 83 //
70 // |entries|: The updated list of password entries. 84 // |entries|: The updated list of password entries.
71 static void onSavedPasswordsListChanged(PasswordUiEntry[] entries); 85 static void onSavedPasswordsListChanged(PasswordUiEntry[] entries);
72 86
73 // Fired when the password exceptions list has changed, meaning that an 87 // 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 88 // entry has been added or removed. Note that this event fires as soon as a
75 // listener is added. 89 // listener is added.
76 // 90 //
77 // |exceptions|: The updated list of password exceptions. 91 // |exceptions|: The updated list of password exceptions.
78 static void onPasswordExceptionsListChanged(DOMString[] exceptions); 92 static void onPasswordExceptionsListChanged(DOMString[] exceptions);
79 93
80 // Fired when a plaintext password has been fetched in response to a call to 94 // Fired when a plaintext password has been fetched in response to a call to
81 // chrome.passwordsPrivate.requestPlaintextPassword(). 95 // chrome.passwordsPrivate.requestPlaintextPassword().
82 // 96 //
83 // |loginPair|: The LoginPair whose password was found. 97 // |loginPair|: The LoginPair whose password was found.
84 // |plaintextPassword|: The plaintext password which was retrieved. 98 // |plaintextPassword|: The plaintext password which was retrieved.
85 static void onPlaintextPasswordRetrieved( 99 static void onPlaintextPasswordRetrieved(
86 PlaintextPasswordEventParameters dict); 100 PlaintextPasswordEventParameters dict);
87 }; 101 };
88 }; 102 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698