blob: ea7cf47559a553c6fe1c64104497906f10fdd065 [file] [log] [blame]
// 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";
import "url/mojo/url.mojom";
enum CredentialType {
EMPTY,
PASSWORD,
FEDERATED
};
enum CredentialMediationRequirement {
kSilent,
kOptional,
kRequired
};
enum CredentialManagerError {
SUCCESS,
DISABLED,
PENDINGREQUEST,
PASSWORDSTOREUNAVAILABLE,
UNKNOWN
};
struct CredentialInfo {
CredentialType type;
string id;
string name;
url.mojom.Url icon;
string password;
url.mojom.Origin federation;
};
interface CredentialManager {
// Store credential. For navigator.credentials.store().
Store(CredentialInfo credential) => ();
// Require user mediation. For navigator.credentials.preventSilentAccess().
PreventSilentAccess() => ();
// 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(CredentialMediationRequirement mediation,
bool include_passwords,
array<url.mojom.Url> federations)
=> (CredentialManagerError error, CredentialInfo? credential);
};