chromium/chrome/common/extensions/api/enterprise_device_attributes.idl

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

// Use the <code>chrome.enterprise.deviceAttributes</code> API to read device
// attributes.
// Note: This API is only available to extensions force-installed by enterprise
// policy.
namespace enterprise.deviceAttributes {
  callback GetDirectoryDeviceIdCallback = void (DOMString deviceId);

  callback GetDeviceSerialNumberCallback = void (DOMString serialNumber);

  callback GetDeviceAssetIdCallback = void (DOMString assetId);

  callback GetDeviceAnnotatedLocationCallback = void (DOMString annotatedLocation);

  callback GetDeviceHostnameCallback = void (DOMString hostname);

  interface Functions {
    // Fetches the value of
    // <a href="https://developers.google.com/admin-sdk/directory/v1/guides/manage-chrome-devices">the device identifier of the directory API</a>,
    // that is generated by the server and identifies the cloud record of the
    // device for querying in the cloud directory API.
    // If the current user is not affiliated, returns an empty string.
    // |callback| : Called with the device identifier of the directory API when
    // received.
    void getDirectoryDeviceId(
        GetDirectoryDeviceIdCallback callback);

    // Fetches the device's serial number. Please note the purpose of this API
    // is to administrate the device (e.g. generating Certificate Sign Requests
    // for device-wide certificates). This API may not be used for tracking
    // devices without the consent of the device's administrator.
    // If the current user is not affiliated, returns an empty string.
    // |callback| : Called with the serial number of the device.
    void getDeviceSerialNumber(
        GetDeviceSerialNumberCallback callback);

    // Fetches the administrator-annotated Asset Id.
    // If the current user is not affiliated or no Asset Id has been set by the
    // administrator, returns an empty string.
    // |callback| : Called with the Asset ID of the device.
    void getDeviceAssetId(GetDeviceAssetIdCallback callback);

    // Fetches the administrator-annotated Location.
    // If the current user is not affiliated or no Annotated Location has been
    // set by the administrator, returns an empty string.
    // |callback| : Called with the Annotated Location of the device.
    void getDeviceAnnotatedLocation(
        GetDeviceAnnotatedLocationCallback callback);

    // Fetches the device's hostname as set by DeviceHostnameTemplate policy.
    // If the current user is not affiliated or no hostname has been set by the
    // enterprise policy, returns an empty string.
    // |callback| : Called with hostname of the device.
    void getDeviceHostname(
        GetDeviceHostnameCallback callback);
  };

};