1// Copyright 2018 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4//
5// Sync protocol datatype extension for user consents.
6
7// If you change or add any fields in this file, update proto_visitors.h and
8// potentially proto_enum_conversions.{h, cc}.
9
10syntax = "proto2";
11
12option java_multiple_files = true;
13option java_package = "org.chromium.components.sync.protocol";
14
15option optimize_for = LITE_RUNTIME;
16
17package sync_pb;
18
19import "components/sync/protocol/user_consent_types.proto";
20
21// Next id: 14
22message UserConsentSpecifics {
23  // ===========================================================================
24  // Fields common to all Chrome User Consents.
25  // ===========================================================================
26
27  // The UI language Chrome is using, represented as the IETF language tag
28  // defined in BCP 47. The region subtag is not included when it adds no
29  // distinguishing information to the language tag (e.g. both "en-US"
30  // and "fr" are correct here).
31  optional string locale = 4;
32
33  // The local time on the client when the user consent was recorded. The time
34  // as measured by client is given in microseconds since Windows epoch. This
35  // is needed since user consent recording may happen when a client is
36  // offline.
37  optional int64 client_consent_time_usec = 12;
38
39  // ===========================================================================
40  // The specific consent type. Add new User Consent types to
41  // user_consent_types.proto.
42  // ===========================================================================
43
44  oneof consent {
45    UserConsentTypes.SyncConsent sync_consent = 7;
46
47    UserConsentTypes.ArcBackupAndRestoreConsent arc_backup_and_restore_consent =
48        8;
49
50    UserConsentTypes.ArcGoogleLocationServiceConsent
51        arc_location_service_consent = 9;
52
53    UserConsentTypes.ArcPlayTermsOfServiceConsent
54        arc_play_terms_of_service_consent = 10;
55
56    UserConsentTypes.UnifiedConsent unified_consent = 13 [deprecated = true];
57
58    UserConsentTypes.AssistantActivityControlConsent
59        assistant_activity_control_consent = 14;
60
61    UserConsentTypes.AccountPasswordsConsent account_passwords_consent = 15;
62  }
63  reserved "arc_metrics_and_usage_consent";
64  reserved 11;
65
66  // ===========================================================================
67  // Client only fields.
68  // ===========================================================================
69  // TODO(markusheintz): Refactor the code so that these fields can be moved out
70  // of this message.
71
72  // The account ID of the user who gave the consent. This field is used
73  // by UserEventService to distinguish consents from different users,
74  // as UserConsent does not get deleted when a user signs out. However,
75  // it should be cleared before being sent over the wire, as the UserEvent
76  // is sent over an authenticated channel, so this information would be
77  // redundant.
78  //
79  // For semantics and usage of the |account_id| in the signin codebase,
80  // see IdentityManager::GetPrimaryAccountId() or CoreAccountId.
81  optional string account_id = 6;
82
83  // ===========================================================================
84  // Deprecated fields. Please do not use them!
85  // They have to remain in the proto because the server must continue
86  // supporting legacy consent formats like this.
87  // ===========================================================================
88
89  // Which feature does the consent apply to?
90  enum Feature {
91    FEATURE_UNSPECIFIED = 0;
92    CHROME_SYNC = 1;
93    PLAY_STORE = 2;
94    BACKUP_AND_RESTORE = 3;
95    GOOGLE_LOCATION_SERVICE = 4;
96    CHROME_UNIFIED_CONSENT = 5;
97    // TODO(markusheintz): ASSISTANT_ACTIVITY_CONTROL was only added for
98    // compatibility with the Feature enum in UserEventSpecifics.UserConsent.
99    // Delete this value once the value is deleted from the other proto.
100    ASSISTANT_ACTIVITY_CONTROL = 6;
101  }
102  optional Feature feature = 1 [deprecated = true];
103  // Ids of the strings of the consent text presented to the user.
104  repeated int32 description_grd_ids = 2 [deprecated = true];
105  // Id of the string of the UI element the user clicked when consenting.
106  optional int32 confirmation_grd_id = 3 [deprecated = true];
107  // Was the consent for |feature| given or not given (denied/revoked)?
108  optional UserConsentTypes.ConsentStatus status = 5 [deprecated = true];
109}
110