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