#include "chrome/browser/plugins/chrome_content_browser_client_plugins_part.h"
#include <memory>
#include <set>
#include <string>
#include <utility>
#include "base/command_line.h"
#include "base/functional/bind.h"
#include "base/no_destructor.h"
#include "base/notreached.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/plugins/plugin_info_host_impl.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/channel_info.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pepper_permission_util.h"
#include "components/version_info/version_info.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "extensions/buildflags/buildflags.h"
#include "mojo/public/cpp/bindings/pending_associated_receiver.h"
#include "mojo/public/cpp/bindings/self_owned_associated_receiver.h"
#include "services/service_manager/public/cpp/binder_registry.h"
#include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h"
#if BUILDFLAG(ENABLE_EXTENSIONS)
#include "chrome/browser/extensions/extension_service.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/common/constants.h"
#include "extensions/common/permissions/permissions_data.h"
#include "extensions/common/permissions/socket_permission.h"
#endif
#if BUILDFLAG(ENABLE_PPAPI)
#include "chrome/browser/renderer_host/pepper/chrome_browser_pepper_host_factory.h"
#include "ppapi/host/ppapi_host.h"
#include "ppapi/shared_impl/ppapi_switches.h"
#endif
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/ash/crostini/crostini_pref_names.h"
#include "chrome/common/webui_url_constants.h"
#endif
namespace plugins {
namespace {
const std::set<std::string>& GetAllowedDevChannelOrigins() { … }
const std::set<std::string>& GetAllowedFileHandleOrigins() { … }
const std::set<std::string>& GetAllowedSocketOrigins() { … }
void BindPluginInfoHost(
int render_process_id,
mojo::PendingAssociatedReceiver<chrome::mojom::PluginInfoHost> receiver) { … }
}
ChromeContentBrowserClientPluginsPart::ChromeContentBrowserClientPluginsPart() =
default;
ChromeContentBrowserClientPluginsPart::
~ChromeContentBrowserClientPluginsPart() = default;
void ChromeContentBrowserClientPluginsPart::
ExposeInterfacesToRendererForRenderFrameHost(
content::RenderFrameHost& render_frame_host,
blink::AssociatedInterfaceRegistry& associated_registry) { … }
bool ChromeContentBrowserClientPluginsPart::
IsPluginAllowedToCallRequestOSFileHandle(
content::BrowserContext* browser_context,
const GURL& url) { … }
bool ChromeContentBrowserClientPluginsPart::AllowPepperSocketAPI(
content::BrowserContext* browser_context,
const GURL& url,
bool private_api,
const content::SocketPermissionRequest* params) { … }
bool ChromeContentBrowserClientPluginsPart::IsPepperVpnProviderAPIAllowed(
content::BrowserContext* browser_context,
const GURL& url) { … }
bool ChromeContentBrowserClientPluginsPart::IsPluginAllowedToUseDevChannelAPIs(
content::BrowserContext* browser_context,
const GURL& url) { … }
void ChromeContentBrowserClientPluginsPart::DidCreatePpapiPlugin(
content::BrowserPpapiHost* browser_host) { … }
}