Commit 0c572e20 authored by Mihai Sardarescu's avatar Mihai Sardarescu Committed by Commit Bot

[unity] Use HISTORY_DELETE_DIRECTIVES to check whether history sync is enabled.

Sync model type TYPED_URLS can be enabled only if the user has encryption,
while HISTORY_DELETE_DIRECTIVES cannot be enabled then. So in order to check
whether the user is sending history to google in a readable way,
HISTORY_DELETE_DIRECTIVES is the better one.

This CL changes the URL-keyed anonymized data collection helper to use
HISTORY_DELETE_DIRECTIVES.

Bug: 823809
Change-Id: Ideb0a6129750f7e0e122e82a0c932aa6acd7bdc6
Reviewed-on: https://chromium-review.googlesource.com/1122118Reviewed-by: default avatarThomas Tangl <tangltom@chromium.org>
Commit-Queue: Mihai Sardarescu <msarda@chromium.org>
Cr-Commit-Position: refs/heads/master@{#572152}
parent bd15e1c9
......@@ -81,9 +81,9 @@ SyncBasedUrlKeyedDataCollectionConsentHelper::
SyncBasedUrlKeyedDataCollectionConsentHelper(
syncer::SyncService* sync_service)
: sync_service_(sync_service),
sync_history_upload_state_(
syncer::GetUploadToGoogleState(sync_service_,
syncer::ModelType::TYPED_URLS)) {
sync_history_upload_state_(syncer::GetUploadToGoogleState(
sync_service_,
syncer::ModelType::HISTORY_DELETE_DIRECTIVES)) {
DCHECK(sync_service_);
sync_service_->AddObserver(this);
}
......@@ -103,7 +103,7 @@ void SyncBasedUrlKeyedDataCollectionConsentHelper::OnStateChanged(
DCHECK_EQ(sync_service_, sync_service);
bool enabled_before_state_updated = IsEnabled();
sync_history_upload_state_ = syncer::GetUploadToGoogleState(
sync_service_, syncer::ModelType::TYPED_URLS);
sync_service_, syncer::ModelType::HISTORY_DELETE_DIRECTIVES);
if (enabled_before_state_updated != IsEnabled())
FireOnStateChanged();
......
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