blob: e62398a431206bd2de6282d786ec32539c8b1274 [file]
// Copyright 2025 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/enterprise/encryption/cache/utils.h"
#include "base/feature_list.h"
#include "components/enterprise/connectors/core/connectors_prefs.h"
#include "components/enterprise/encryption/core/features.h"
#include "components/prefs/pref_service.h"
namespace enterprise_encryption {
bool ShouldEncryptHttpCache(const PrefService* prefs) {
if (base::FeatureList::IsEnabled(kEnableCacheEncryptionForTesting)) {
return true;
}
if (!prefs) {
return false;
}
return base::FeatureList::IsEnabled(kEnableCacheEncryption) &&
prefs->GetBoolean(enterprise_connectors::kCacheEncryptionEnabledPref);
}
} // namespace enterprise_encryption