chromium/components/sync/protocol/user_consent_types.proto

// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Various user consent types used when reporting consent.

// If you change or add any fields in this file, update proto_visitors.h and
// potentially proto_enum_conversions.{h, cc}.

syntax = "proto2";

option java_multiple_files = true;
option java_package = "org.chromium.components.sync.protocol";

option optimize_for = LITE_RUNTIME;

package sync_pb;

message UserConsentTypes {
  // The status of a particular User Consent. The status describes the state
  // of the consent as it is: given, not_given.
  enum ConsentStatus {
    // The status is unspecified e.g. because the user was not asked to
    // consent yet or an error happened or the decision was delayed.
    CONSENT_STATUS_UNSPECIFIED = 0;
    // The consent is not given. This means the user either revoked the
    // consent or did not grant it in the first place.
    NOT_GIVEN = 1;
    // The consent is given. This means the user did grant the consent.
    GIVEN = 2;
  }

  // ===========================================================================
  // Keep sorted alphabetically.
  // Don't forget to update proto_visitors.h and potentially
  // proto_enum_conversions.{h, cc}. Never TBR proto changes, because they need
  // to be manually imported on the Sync server.
  // ===========================================================================

  // The user consent for the ARC Backup And Restore feature. The consent
  // status is determined by the corresponding setting on the ARC setup dialog.
  message ArcBackupAndRestoreConsent {
    // Ids of the strings of the setting text presented to the user.
    repeated int32 description_grd_ids = 1;

    // Id of the string of the UI element the user clicked when consenting.
    optional int32 confirmation_grd_id = 2;

    optional ConsentStatus status = 3;
  }

  // The user consent for the Google Location Service. The consent status is
  // determined by the corresponding setting on the ARC setup dialog.
  message ArcGoogleLocationServiceConsent {
    // Ids of the strings of the setting text presented to the user.
    repeated int32 description_grd_ids = 1;

    // Id of the string of the UI element the user clicked when consenting.
    optional int32 confirmation_grd_id = 2;

    optional ConsentStatus status = 3;
  }

  // The user consent for the Play terms of service is determined by the user
  // action on the ARC setup dialog that presents the Play Terms of Service.
  message ArcPlayTermsOfServiceConsent {
    // The length of the UTF-8 encoded string of the Play Terms of Service
    // text. The length is given in number of bytes.
    optional int32 play_terms_of_service_text_length = 1;

    // The SHA1 hash of UTF-8 encoded string of the Play Terms of Service
    // displayed to the user.
    optional bytes play_terms_of_service_hash = 2;

    // GRD Ids of the strings on the consent UI that was shown to the user.
    repeated int32 description_grd_ids = 5;

    // Id of the string of the UI element the user clicked when consenting.
    optional int32 confirmation_grd_id = 3;

    // The status of the Play Terms of Service consent. This specifies whether
    // the consent was given or not given/revoked.
    optional ConsentStatus status = 4;

    // Enum describing different user flow during which the ARC Play Terms of
    // service consent can be recorded.
    enum ConsentFlow {
      // The ARC setup flow on a CROS device.
      SETUP = 1;
      // The user flow for changing the ARC setting on a CROS device.
      SETTING_CHANGE = 2;
    }
    // The user flow during which the consent was recorded. This is necessary in
    // order to create the correct UI context and Event for the backend.
    optional ConsentFlow consent_flow = 6;
  }

  // The User Consent for Chrome Sync is determined by the user action on the
  // corresponding Sync Consent dialog.
  message SyncConsent {
    // Ids of the strings of the sync consent text presented to the user.
    repeated int32 description_grd_ids = 1;

    // Id of the string of the UI element the user clicked in order to confirm
    // and close the sync consent dialog.
    optional int32 confirmation_grd_id = 2;

    // The status of the sync consent. This specifies whether the consent was
    // given or not given/revoked.
    optional ConsentStatus status = 3;
  }

  // The unified User Consent for Chrome is determined by the user action on the
  // corresponding Chrome Consent dialog.
  message UnifiedConsent {
    // Ids of the strings of the unified Chrome consent text presented to the
    // user.
    repeated int32 description_grd_ids = 1;

    // Id of the string of the UI element the user clicked in order to confirm
    // and close the unified Chrome consent dialog.
    optional int32 confirmation_grd_id = 2;

    // The status of the unified Chrome consent. This specifies whether the
    // consent was given or not given/revoked.
    optional ConsentStatus status = 3;
  }

  // The User Consent for Assistant activity control is determined by the user
  // action on the Assistant opt-in flow.
  message AssistantActivityControlConsent {
    // An opaque token to for ui auditing, which strengthens the audit trail.
    optional bytes ui_audit_key = 1;

    // The status of the Assistant activity control consent. This specifies
    // whether the consent was given or not given.
    optional ConsentStatus status = 2;

    // Enum denoting different Assistant activity control setting type.
    enum SettingType {
      // Legacy clients (< M93) did not set a SettingType; for those,
      // UNSPECIFIED should be interpreted as ALL. Newer clients should always
      // set it explicitly.
      SETTING_TYPE_UNSPECIFIED = 0;
      // All Settings.
      ALL = 1;
      WEB_AND_APP_ACTIVITY = 2;
      DEVICE_APPS = 3;
    }

    // The activity control setting which the consent was given or not given to.
    // Clients before M93 did not set this field. Such consents should be
    // treated as applying to ALL.
    optional SettingType setting_type = 3;
  }

  // The User Consent for downloading and using passwords stored in the user's
  // Google Account. Determined during the opt-in flow for the feature.
  message AccountPasswordsConsent {
    // Ids of the strings of the consent text presented to the user.
    repeated int32 description_grd_ids = 1;

    // Id of the string of the UI element the user clicked in order to confirm
    // the consent dialog.
    optional int32 confirmation_grd_id = 2;

    // The status of the consent. This specifies whether the consent was given
    // or not given/revoked.
    optional ConsentStatus status = 3;
  }

  // The User Consent for enabling or disabling speaker label feature in
  // Recorder app.
  message RecorderSpeakerLabelConsent {
    // Ids of the strings of the Recorder speaker label consent text presented
    // to the user.
    repeated int32 description_grd_ids = 1;

    // Id of the string of the UI element the user clicked in order to give or
    // not give the consent and close the Recorder speaker label consent
    // dialog.
    optional int32 confirmation_grd_id = 2;

    // The status of the Recorder speaker label consent. This specifies whether
    // the consent was given or not given/revoked.
    optional ConsentStatus status = 3;
  }
}