blob: 2ad4be835387d7cc84268a65807d4d1fad2ee84d [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,
PENDING_REQUEST,
PASSWORD_STORE_UNAVAILABLE,
NOT_ALLOWED,
NOT_SUPPORTED,
INVALID_DOMAIN,
TIMED_OUT,
NOT_IMPLEMENTED,
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);
};