// Copyright 2011 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_CONTENT_SETTINGS_CORE_COMMON_CONTENT_SETTINGS_H_ #define COMPONENTS_CONTENT_SETTINGS_CORE_COMMON_CONTENT_SETTINGS_H_ #include <stddef.h> #include <map> #include <string> #include <vector> #include "base/time/time.h" #include "base/values.h" #include "components/content_settings/core/common/content_settings_constraints.h" #include "components/content_settings/core/common/content_settings_metadata.h" #include "components/content_settings/core/common/content_settings_pattern.h" #include "components/content_settings/core/common/content_settings_rules.h" #include "components/content_settings/core/common/content_settings_types.h" // Different settings that can be assigned for a particular content type. We // give the user the ability to set these on a global and per-origin basis. // A Java counterpart will be generated for this enum. // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.components.content_settings // GENERATED_JAVA_CLASS_NAME_OVERRIDE: ContentSettingValues // // TODO(nigeltao): migrate the Java users of this enum to the mojom-generated // enum. enum ContentSetting { … }; // Range-checked conversion of an int to a ContentSetting, for use when reading // prefs off disk. ContentSetting IntToContentSetting(int content_setting); struct ContentSettingPatternSource { … }; // Formatter method for Google Test. std::ostream& operator<<(std::ostream& os, const ContentSettingPatternSource& source); ContentSettingsForOneType; struct RendererContentSettingRules { … }; namespace content_settings { ProviderType; // Enum containing the various source for content settings. Settings can be // set by policy, extension, the user or by the custodian of a supervised user. // Certain (internal) origins are allowlisted. For these origins the source is // |SettingSource::kAllowList|. enum class SettingSource { … }; // |SettingInfo| provides meta data for content setting values. |source| // contains the source of a value. |primary_pattern| and |secondary_pattern| // contains the patterns of the appling rule. struct SettingInfo { … }; // Returns the SettingSource associated with the given ProviderType. constexpr SettingSource GetSettingSourceFromProviderType( ProviderType provider_type) { … } } // namespace content_settings #endif // COMPONENTS_CONTENT_SETTINGS_CORE_COMMON_CONTENT_SETTINGS_H_