#include "chrome/browser/content_settings/page_specific_content_settings_delegate.h"
#include "base/feature_list.h"
#include "build/build_config.h"
#include "chrome/browser/browsing_data/browsing_data_file_system_util.h"
#include "chrome/browser/browsing_data/chrome_browsing_data_model_delegate.h"
#include "chrome/browser/content_settings/chrome_content_settings_utils.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h"
#include "chrome/browser/media/webrtc/media_stream_capture_indicator.h"
#include "chrome/browser/permissions/permission_decision_auto_blocker_factory.h"
#include "chrome/browser/picture_in_picture/picture_in_picture_window_manager.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/renderer_configuration.mojom.h"
#include "components/content_settings/browser/page_specific_content_settings.h"
#include "components/content_settings/core/common/content_settings.h"
#include "components/content_settings/core/common/content_settings_utils.h"
#include "components/content_settings/core/common/features.h"
#include "components/permissions/permission_decision_auto_blocker.h"
#include "components/permissions/permission_recovery_success_rate_tracker.h"
#include "components/permissions/permission_uma_util.h"
#include "components/prefs/pref_service.h"
#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "extensions/buildflags/buildflags.h"
#include "ipc/ipc_channel_proxy.h"
#include "pdf/buildflags.h"
#if BUILDFLAG(ENABLE_EXTENSIONS)
#include "components/guest_view/browser/guest_view_base.h"
#endif
#if BUILDFLAG(ENABLE_PDF)
#include "chrome/browser/pdf/pdf_viewer_stream_manager.h"
#include "pdf/pdf_features.h"
#endif
#if BUILDFLAG(IS_MAC)
#include "chrome/browser/media/webrtc/system_media_capture_permissions_mac.h"
#endif
PageSpecificContentSettings;
PageSpecificContentSettingsDelegate::PageSpecificContentSettingsDelegate(
content::WebContents* web_contents)
: … { … }
PageSpecificContentSettingsDelegate::~PageSpecificContentSettingsDelegate() =
default;
PageSpecificContentSettingsDelegate*
PageSpecificContentSettingsDelegate::FromWebContents(
content::WebContents* web_contents) { … }
void PageSpecificContentSettingsDelegate::OnIsCapturingVideoChanged(
content::WebContents* web_contents,
bool is_capturing_video) { … }
void PageSpecificContentSettingsDelegate::OnIsCapturingAudioChanged(
content::WebContents* web_contents,
bool is_capturing_audio) { … }
void PageSpecificContentSettingsDelegate::OnCapturingStateChanged(
content::WebContents* web_contents,
ContentSettingsType type,
bool is_capturing) { … }
void PageSpecificContentSettingsDelegate::UpdateLocationBar() { … }
PrefService* PageSpecificContentSettingsDelegate::GetPrefs() { … }
HostContentSettingsMap* PageSpecificContentSettingsDelegate::GetSettingsMap() { … }
std::unique_ptr<BrowsingDataModel::Delegate>
PageSpecificContentSettingsDelegate::CreateBrowsingDataModelDelegate() { … }
namespace {
#if BUILDFLAG(ENABLE_EXTENSIONS)
void GetGuestViewDefaultContentSettingRules(
bool incognito,
RendererContentSettingRules* rules) { … }
#endif
}
void PageSpecificContentSettingsDelegate::SetDefaultRendererContentSettingRules(
content::RenderFrameHost* rfh,
RendererContentSettingRules* rules) { … }
PageSpecificContentSettings::MicrophoneCameraState
PageSpecificContentSettingsDelegate::GetMicrophoneCameraState() { … }
content::WebContents* PageSpecificContentSettingsDelegate::
MaybeGetSyncedWebContentsForPictureInPicture(
content::WebContents* web_contents) { … }
void PageSpecificContentSettingsDelegate::OnContentAllowed(
ContentSettingsType type) { … }
void PageSpecificContentSettingsDelegate::OnContentBlocked(
ContentSettingsType type) { … }
bool PageSpecificContentSettingsDelegate::IsBlockedOnSystemLevel(
ContentSettingsType type) { … }
bool PageSpecificContentSettingsDelegate::IsFrameAllowlistedForJavaScript(
content::RenderFrameHost* render_frame_host) { … }
void PageSpecificContentSettingsDelegate::PrimaryPageChanged(
content::Page& page) { … }