chromium/components/content_settings/core/browser/content_settings_default_provider.cc

// Copyright 2012 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/content_settings/core/browser/content_settings_default_provider.h"

#include <memory>
#include <string>

#include "base/auto_reset.h"
#include "base/functional/bind.h"
#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_functions.h"
#include "base/trace_event/trace_event.h"
#include "build/blink_buildflags.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "components/content_settings/core/browser/content_settings_info.h"
#include "components/content_settings/core/browser/content_settings_registry.h"
#include "components/content_settings/core/browser/content_settings_rule.h"
#include "components/content_settings/core/browser/content_settings_utils.h"
#include "components/content_settings/core/browser/website_settings_info.h"
#include "components/content_settings/core/browser/website_settings_registry.h"
#include "components/content_settings/core/common/content_settings.h"
#include "components/content_settings/core/common/content_settings_pattern.h"
#include "components/content_settings/core/common/content_settings_utils.h"
#include "components/content_settings/core/common/pref_names.h"
#include "components/pref_registry/pref_registry_syncable.h"
#include "components/prefs/pref_change_registrar.h"
#include "components/prefs/pref_registry.h"
#include "components/prefs/pref_service.h"
#include "components/prefs/scoped_user_pref_update.h"
#include "url/gurl.h"

namespace content_settings {

namespace {

// These settings are no longer used, and should be deleted on profile startup.
#if !BUILDFLAG(IS_IOS)
// The "nfc" preference was superseded by "nfc-devices" once Web NFC gained the
// ability to make NFC tags permanently read-only. See crbug.com/1275576
const char kObsoleteNfcDefaultPref[] =;
#if !BUILDFLAG(IS_ANDROID)
const char kObsoleteMouseLockDefaultPref[] =;
const char kObsoletePluginsDefaultPref[] =;
const char kObsoletePluginsDataDefaultPref[] =;
const char kObsoleteFileHandlingDefaultPref[] =;
const char kObsoleteFontAccessDefaultPref[] =;
const char kObsoleteInstalledWebAppMetadataDefaultPref[] =;
const char kObsoletePpapiBrokerDefaultPref[] =;
#endif  // !BUILDFLAG(IS_ANDROID)
#endif  // !BUILDFLAG(IS_IOS)
constexpr char kObsoleteFederatedIdentityDefaultPref[] =;

ContentSetting GetDefaultValue(const WebsiteSettingsInfo* info) {}

ContentSetting GetDefaultValue(ContentSettingsType type) {}

const std::string& GetPrefName(ContentSettingsType type) {}

class DefaultRuleIterator : public RuleIterator {};

}  // namespace

// static
void DefaultProvider::RegisterProfilePrefs(
    user_prefs::PrefRegistrySyncable* registry) {}

DefaultProvider::DefaultProvider(PrefService* prefs,
                                 bool off_the_record,
                                 bool should_record_metrics)
    :{}

DefaultProvider::~DefaultProvider() = default;

// TODO(b/307193732): handle the PartitionKey in all relevant methods, including
// when we call NotifyObservers().
bool DefaultProvider::SetWebsiteSetting(
    const ContentSettingsPattern& primary_pattern,
    const ContentSettingsPattern& secondary_pattern,
    ContentSettingsType content_type,
    base::Value&& in_value,
    const ContentSettingConstraints& constraints,
    const PartitionKey& partition_key) {}

std::unique_ptr<RuleIterator> DefaultProvider::GetRuleIterator(
    ContentSettingsType content_type,
    bool off_the_record,
    const PartitionKey& partition_key) const {}

std::unique_ptr<Rule> DefaultProvider::GetRule(
    const GURL& primary_url,
    const GURL& secondary_url,
    ContentSettingsType content_type,
    bool off_the_record,
    const PartitionKey& partition_key) const {}

void DefaultProvider::ClearAllContentSettingsRules(
    ContentSettingsType content_type,
    const PartitionKey& partition_key) {}

void DefaultProvider::ShutdownOnUIThread() {}

void DefaultProvider::ReadDefaultSettings() {}

bool DefaultProvider::IsValueEmptyOrDefault(ContentSettingsType content_type,
                                            const base::Value& value) {}

void DefaultProvider::ChangeSetting(ContentSettingsType content_type,
                                    base::Value value) {}

void DefaultProvider::WriteToPref(ContentSettingsType content_type,
                                  const base::Value& value) {}

void DefaultProvider::OnPreferenceChanged(const std::string& name) {}

base::Value DefaultProvider::ReadFromPref(ContentSettingsType content_type) {}

void DefaultProvider::DiscardOrMigrateObsoletePreferences() {}

void DefaultProvider::RecordHistogramMetrics() {}

}  // namespace content_settings