user_consent_specifics.proto 4.5 KB

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