| Index: chrome/browser/sync/util/cryptographer.cc
|
| diff --git a/chrome/browser/sync/util/cryptographer.cc b/chrome/browser/sync/util/cryptographer.cc
|
| index 4990d8b9f275f353de6ba7ef9e92263eada4ea19..dde6fb7d3543e8598bc56f1ef4d83d0a8b40efa9 100644
|
| --- a/chrome/browser/sync/util/cryptographer.cc
|
| +++ b/chrome/browser/sync/util/cryptographer.cc
|
| @@ -2,6 +2,8 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| +#include <algorithm>
|
| +
|
| #include "base/base64.h"
|
| #include "chrome/browser/sync/util/cryptographer.h"
|
| #include "chrome/browser/password_manager/encryptor.h"
|
| @@ -326,7 +328,7 @@ void Cryptographer::UpdateEncryptedTypesFromNigori(
|
| return;
|
| }
|
|
|
| - SetEncryptedTypes(encrypted_types);
|
| + MergeEncryptedTypes(encrypted_types);
|
| }
|
|
|
| void Cryptographer::UpdateNigoriFromEncryptedTypes(
|
| @@ -376,14 +378,15 @@ syncable::ModelTypeSet Cryptographer::GetEncryptedTypes() const {
|
| return encrypted_types_;
|
| }
|
|
|
| -void Cryptographer::SetEncryptedTypesForTest(
|
| +void Cryptographer::MergeEncryptedTypesForTest(
|
| const syncable::ModelTypeSet& encrypted_types) {
|
| - SetEncryptedTypes(encrypted_types);
|
| + MergeEncryptedTypes(encrypted_types);
|
| }
|
|
|
| -void Cryptographer::SetEncryptedTypes(
|
| +void Cryptographer::MergeEncryptedTypes(
|
| const syncable::ModelTypeSet& encrypted_types) {
|
| - if (encrypted_types_ == encrypted_types) {
|
| + if (std::includes(encrypted_types_.begin(), encrypted_types_.end(),
|
| + encrypted_types.begin(), encrypted_types.end())) {
|
| return;
|
| }
|
| encrypted_types_.insert(encrypted_types.begin(), encrypted_types.end());
|
|
|