Index: components/password_manager/content/public/interfaces/credential_manager.mojom |
diff --git a/components/password_manager/content/public/interfaces/credential_manager.mojom b/components/password_manager/content/public/interfaces/credential_manager.mojom |
new file mode 100644 |
index 0000000000000000000000000000000000000000..cc9492bb68aaf65b10ed77f8426d2cebddd7f7f7 |
--- /dev/null |
+++ b/components/password_manager/content/public/interfaces/credential_manager.mojom |
@@ -0,0 +1,44 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+module password_manager.mojom; |
+ |
+import "url/mojo/origin.mojom"; |
+ |
+enum CredentialType { |
+ EMPTY, |
+ PASSWORD, |
+ FEDERATED |
+}; |
+ |
+enum CredentialManagerError { |
+ SUCCESS, |
+ DISABLED, |
+ PENDINGREQUEST, |
+ PASSWORDSTOREUNAVAILABLE, |
+ UNKNOWN |
+}; |
+ |
+struct CredentialInfo { |
+ CredentialType type = EMPTY; |
+ string id = ""; |
+ string name = ""; |
+ string icon = ""; |
+ string password = ""; |
+ url.mojom.Origin federation; |
+}; |
+ |
+interface CredentialManager { |
+ // Store credential. For navigator.credentials.store(). |
+ Store(CredentialInfo credential) => (); |
+ |
+ // Require user mediation. For navigator.credentials.requireUserMediation(). |
+ RequireUserMediation() => (); |
+ |
+ // Get Credential. For navigator.credentials.get(). |
+ // The result callback will return a non-null and valid CredentialInfo |
+ // if succeeded, or null with a CredentialManagerError if failed. |
+ Get(bool zero_click_only, bool include_passwords, array<string> federations) |
+ => (CredentialManagerError error, CredentialInfo? credential); |
+}; |