OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 module password_manager.mojom; | 5 module password_manager.mojom; |
6 | 6 |
7 import "url/mojo/origin.mojom"; | 7 import "url/mojo/origin.mojom"; |
| 8 import "url/mojo/url.mojom"; |
8 | 9 |
9 enum CredentialType { | 10 enum CredentialType { |
10 EMPTY, | 11 EMPTY, |
11 PASSWORD, | 12 PASSWORD, |
12 FEDERATED | 13 FEDERATED |
13 }; | 14 }; |
14 | 15 |
15 enum CredentialManagerError { | 16 enum CredentialManagerError { |
16 SUCCESS, | 17 SUCCESS, |
17 DISABLED, | 18 DISABLED, |
18 PENDINGREQUEST, | 19 PENDINGREQUEST, |
19 PASSWORDSTOREUNAVAILABLE, | 20 PASSWORDSTOREUNAVAILABLE, |
20 UNKNOWN | 21 UNKNOWN |
21 }; | 22 }; |
22 | 23 |
23 struct CredentialInfo { | 24 struct CredentialInfo { |
24 CredentialType type = EMPTY; | 25 CredentialType type = EMPTY; |
25 string id = ""; | 26 string id = ""; |
26 string name = ""; | 27 string name = ""; |
27 string icon = ""; | 28 url.mojom.Url icon; |
28 string password = ""; | 29 string password = ""; |
29 url.mojom.Origin federation; | 30 url.mojom.Origin federation; |
30 }; | 31 }; |
31 | 32 |
32 interface CredentialManager { | 33 interface CredentialManager { |
33 // Store credential. For navigator.credentials.store(). | 34 // Store credential. For navigator.credentials.store(). |
34 Store(CredentialInfo credential) => (); | 35 Store(CredentialInfo credential) => (); |
35 | 36 |
36 // Require user mediation. For navigator.credentials.requireUserMediation(). | 37 // Require user mediation. For navigator.credentials.requireUserMediation(). |
37 RequireUserMediation() => (); | 38 RequireUserMediation() => (); |
38 | 39 |
39 // Get Credential. For navigator.credentials.get(). | 40 // Get Credential. For navigator.credentials.get(). |
40 // The result callback will return a non-null and valid CredentialInfo | 41 // The result callback will return a non-null and valid CredentialInfo |
41 // if succeeded, or null with a CredentialManagerError if failed. | 42 // if succeeded, or null with a CredentialManagerError if failed. |
42 Get(bool zero_click_only, bool include_passwords, array<string> federations) | 43 Get(bool zero_click_only, |
| 44 bool include_passwords, |
| 45 array<url.mojom.Url> federations) |
43 => (CredentialManagerError error, CredentialInfo? credential); | 46 => (CredentialManagerError error, CredentialInfo? credential); |
44 }; | 47 }; |
OLD | NEW |