Commit a3b26bf2 authored by Marc Treib's avatar Marc Treib Committed by Commit Bot

Sync: Enable SECURITY_EVENTS for signed-in non-syncing users

Bug: 996170
Change-Id: I46b322cc58635a6509a53ad4fb14a58067491e25
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1757933Reviewed-by: default avatarJan Krcal <jkrcal@chromium.org>
Commit-Queue: Marc Treib <treib@chromium.org>
Cr-Commit-Position: refs/heads/master@{#689405}
parent d912f813
......@@ -292,12 +292,20 @@ ChromeSyncClient::CreateDataTypeControllers(syncer::SyncService* sync_service) {
&syncer::ReportUnrecoverableError, chrome::GetChannel());
if (!disabled_types.Has(syncer::SECURITY_EVENTS)) {
syncer::ModelTypeControllerDelegate* delegate =
SecurityEventRecorderFactory::GetForProfile(profile_)
->GetControllerDelegate()
.get();
// Forward both on-disk and in-memory storage modes to the same delegate,
// since behavior for SECURITY_EVENTS does not differ.
controllers.push_back(std::make_unique<syncer::ModelTypeController>(
syncer::SECURITY_EVENTS,
/*delegate_on_disk=*/
std::make_unique<syncer::ForwardingModelTypeControllerDelegate>(
SecurityEventRecorderFactory::GetForProfile(profile_)
->GetControllerDelegate()
.get())));
delegate),
/*delegate_in_memory=*/
std::make_unique<syncer::ForwardingModelTypeControllerDelegate>(
delegate)));
}
#if BUILDFLAG(ENABLE_SUPERVISED_USERS)
......
......@@ -23,6 +23,7 @@ syncer::ModelTypeSet AllowedTypesInStandaloneTransportMode() {
// Only some special whitelisted types (and control types) are allowed in
// standalone transport mode.
syncer::ModelTypeSet allowed_types(syncer::USER_CONSENTS,
syncer::SECURITY_EVENTS,
syncer::AUTOFILL_WALLET_DATA);
allowed_types.PutAll(syncer::ControlTypes());
return allowed_types;
......
......@@ -24,6 +24,7 @@ syncer::ModelTypeSet AllowedTypesInStandaloneTransportMode() {
// Only some special whitelisted types (and control types) are allowed in
// standalone transport mode.
syncer::ModelTypeSet allowed_types(syncer::USER_CONSENTS,
syncer::SECURITY_EVENTS,
syncer::AUTOFILL_WALLET_DATA);
allowed_types.PutAll(syncer::ControlTypes());
return allowed_types;
......
......@@ -1260,7 +1260,7 @@ void ProfileSyncService::ConfigureDataTypeManager(ConfigureReason reason) {
ModelTypeSet types = GetPreferredDataTypes();
// In transport-only mode, only a subset of data types is supported.
if (use_transport_only_mode) {
ModelTypeSet allowed_types = {USER_CONSENTS};
ModelTypeSet allowed_types = {USER_CONSENTS, SECURITY_EVENTS};
if (autofill_enable_account_wallet_storage_) {
if (!GetUserSettings()->IsUsingSecondaryPassphrase() ||
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment