Commit 4c459f7a authored by dubroy@chromium.org's avatar dubroy@chromium.org

Disable history delete directives when sessions are encrypted.

Full history sync is based on server-side process of session data, so
if session data is encrypted, it can't be read on the server. In this
case, delete directives are also unnecessary, so they can be disabled
whenever the session data type is encrypted.

BUG=229015

Review URL: https://codereview.chromium.org/14139010

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195154 0039d316-1c4b-4281-b951-d872f2087c98
parent ca479fec
......@@ -1117,6 +1117,15 @@ void ProfileSyncService::OnEncryptedTypesChanged(
<< " (encrypt everything is set to "
<< (encrypt_everything_ ? "true" : "false") << ")";
DCHECK(encrypted_types_.Has(syncer::PASSWORDS));
// If sessions are encrypted, full history sync is not possible, and
// delete directives are unnecessary.
if (GetPreferredDataTypes().Has(syncer::HISTORY_DELETE_DIRECTIVES) &&
encrypted_types_.Has(syncer::SESSIONS)) {
DisableBrokenDatatype(syncer::HISTORY_DELETE_DIRECTIVES,
FROM_HERE,
"Delete directives not supported with encryption.");
}
}
void ProfileSyncService::OnEncryptionComplete() {
......
......@@ -214,10 +214,6 @@ void SyncPrefs::SetKeepEverythingSynced(bool keep_everything_synced) {
keep_everything_synced);
}
// TODO(akalin): If encryption is turned on for all data types,
// history delete directives are useless and so we shouldn't bother
// enabling them.
syncer::ModelTypeSet SyncPrefs::GetPreferredDataTypes(
syncer::ModelTypeSet registered_types) const {
DCHECK(CalledOnValidThread());
......
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