blob: a11be335fa6015c3c260019fdb7a6c5925047a74 [file] [log] [blame]
// Copyright 2018 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.
//
// Sync protocol datatype extension for user consents.
// If you change or add any fields in this file, update proto_visitors.h and
// potentially proto_enum_conversions.{h, cc}.
syntax = "proto2";
option optimize_for = LITE_RUNTIME;
package sync_pb;
import "sync_enums.proto";
import "user_consent_types.proto";
// Next id: 14
message UserConsentSpecifics {
// ===========================================================================
// Fields common to all Chrome User Consents.
// ===========================================================================
// The UI language Chrome is using, represented as the IETF language tag
// defined in BCP 47. The region subtag is not included when it adds no
// distinguishing information to the language tag (e.g. both "en-US"
// and "fr" are correct here).
optional string locale = 4;
// The local time on the client when the user consent was recorded. The time
// as measured by client is given in microseconds since Windows epoch. This
// is needed since user consent recording may happen when a client is
// offline.
optional int64 client_consent_time_usec = 12;
// ===========================================================================
// The specific consent type. Add new User Consent types to
// user_consent_types.proto.
// ===========================================================================
oneof consent {
UserConsentTypes.SyncConsent sync_consent = 7;
UserConsentTypes.ArcBackupAndRestoreConsent arc_backup_and_restore_consent =
8;
UserConsentTypes.ArcGoogleLocationServiceConsent
arc_location_service_consent = 9;
UserConsentTypes.ArcPlayTermsOfServiceConsent
arc_play_terms_of_service_consent = 10;
UserConsentTypes.ArcMetricsAndUsageConsent arc_metrics_and_usage_consent =
11;
UserConsentTypes.UnifiedConsent unified_consent = 13;
}
// ===========================================================================
// Client only fields.
// ===========================================================================
// TODO(markusheintz): Refactor the code so that these fields can be moved out
// of this message.
// The account ID of the user who gave the consent. This field is used
// by UserEventService to distinguish consents from different users,
// as UserConsent does not get deleted when a user signs out. However,
// it should be cleared before being sent over the wire, as the UserEvent
// is sent over an authenticated channel, so this information would be
// redundant.
//
// For semantics and usage of the |account_id| in the signin codebase,
// see SigninManagerBase::GetAuthenticatedAccountId()
// or AccountInfo::account_id.
optional string account_id = 6;
// ===========================================================================
// Deprecated fields. Please do not use them !
// ===========================================================================
// TODO(vitaliii): Deprecate them completely once the USER_CONSENTS bridge
// uses the fields above instead.
// Which feature does the consent apply to?
enum Feature {
FEATURE_UNSPECIFIED = 0;
CHROME_SYNC = 1;
PLAY_STORE = 2;
BACKUP_AND_RESTORE = 3;
GOOGLE_LOCATION_SERVICE = 4;
CHROME_UNIFIED_CONSENT = 5;
}
optional Feature feature = 1 [deprecated = true];
// Ids of the strings of the consent text presented to the user.
repeated int32 description_grd_ids = 2 [deprecated = true];
// Id of the string of the UI element the user clicked when consenting.
optional int32 confirmation_grd_id = 3 [deprecated = true];
// Was the consent for |feature| given or not given (denied/revoked)?
optional UserConsentTypes.ConsentStatus status = 5 [deprecated = true];
}