Update privacy_sandbox_settings.cc

This commit is contained in:
Alexander David Frick 2022-08-20 19:31:35 -05:00 committed by GitHub
parent 8c6a4b4327
commit d9ed0eee7e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -114,10 +114,10 @@ bool PrivacySandboxSettings::IsTopicsAllowedForContext(
}
bool PrivacySandboxSettings::IsTopicAllowed(const CanonicalTopic& topic) {
auto* blocked_topics =
pref_service_->GetList(prefs::kPrivacySandboxBlockedTopics);
const auto& blocked_topics =
pref_service_->GetValueList(prefs::kPrivacySandboxBlockedTopics);
for (const auto& item : blocked_topics->GetList()) {
for (const auto& item : blocked_topics) {
auto blocked_topic =
CanonicalTopic::FromValue(*item.GetDict().Find(kBlockedTopicsTopicKey));
if (!blocked_topic)
@ -328,8 +328,15 @@ bool PrivacySandboxSettings::IsSharedStorageAllowed(
top_frame_origin);
}
bool PrivacySandboxSettings::IsPrivateAggregationAllowed(
const url::Origin& top_frame_origin,
const url::Origin& reporting_origin) const {
return IsPrivacySandboxEnabledForContext(reporting_origin.GetURL(),
top_frame_origin);
}
bool PrivacySandboxSettings::IsPrivacySandboxEnabled() const {
// If the delegate is restricting access, the Privacy Sandbox is disabled.
// If the delegate is restricting access the Privacy Sandbox is disabled.
if (delegate_->IsPrivacySandboxRestricted())
return false;