chromium/chromeos/crosapi/mojom/echo_private.mojom

// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

module crosapi.mojom;

[Stable, Extensible]
enum RegistrationCodeType {
  kCoupon,
  kGroup,
};

// EchoPrivate is a service used to provide trusted websites a mechanism to
// confirm the device is a ChromeOS device. Allowed users may then receive
// offers. Implemented in Ash.
[Stable, Uuid="021dafa4-ff41-42ad-9158-98d8e7f1ad6a"]
interface EchoPrivate {
  // Checks TPM state to ensure the device is allowed to redeem offers. If it
  // is, the user is then prompted to confirm. Returns true only if all checks
  // pass.
  CheckRedeemOffersAllowed@0(
      string window_id, string service_name, string origin) => (bool allowed);

  // Returns the contents of the oobe timestamp file in string format. The
  // result should be considered an opaque value that is directly passed to the
  // extension. Failure is reported as empty string.
  [MinVersion=1]
  GetOobeTimestamp@1() => (string timestamp);

  // Returns an opaque string associated with the coupon or group type.
  [MinVersion=2]
  GetRegistrationCode@2(RegistrationCodeType type) => (string result);
};