#include "extensions/browser/extension_host_registry.h"
#include "base/check.h"
#include "base/containers/contains.h"
#include "base/no_destructor.h"
#include "base/observer_list.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
#include "content/public/browser/render_frame_host.h"
#include "extensions/browser/extension_host.h"
#include "extensions/browser/extensions_browser_client.h"
namespace extensions {
namespace {
class ExtensionHostRegistryFactory : public BrowserContextKeyedServiceFactory { … };
ExtensionHostRegistryFactory::ExtensionHostRegistryFactory()
: … { … }
ExtensionHostRegistry* ExtensionHostRegistryFactory::GetForBrowserContext(
content::BrowserContext* browser_context) { … }
content::BrowserContext* ExtensionHostRegistryFactory::GetBrowserContextToUse(
content::BrowserContext* context) const { … }
KeyedService* ExtensionHostRegistryFactory::BuildServiceInstanceFor(
content::BrowserContext* context) const { … }
}
ExtensionHostRegistry::ExtensionHostRegistry() = default;
ExtensionHostRegistry::~ExtensionHostRegistry() = default;
ExtensionHostRegistry* ExtensionHostRegistry::Get(
content::BrowserContext* browser_context) { … }
BrowserContextKeyedServiceFactory* ExtensionHostRegistry::GetFactory() { … }
void ExtensionHostRegistry::ExtensionHostCreated(
ExtensionHost* extension_host) { … }
void ExtensionHostRegistry::ExtensionHostRenderProcessReady(
ExtensionHost* extension_host) { … }
void ExtensionHostRegistry::ExtensionHostCompletedFirstLoad(
ExtensionHost* extension_host) { … }
void ExtensionHostRegistry::ExtensionHostDocumentElementAvailable(
ExtensionHost* extension_host) { … }
void ExtensionHostRegistry::ExtensionHostRenderProcessGone(
ExtensionHost* extension_host) { … }
void ExtensionHostRegistry::ExtensionHostDestroyed(
ExtensionHost* extension_host) { … }
std::vector<ExtensionHost*> ExtensionHostRegistry::GetHostsForExtension(
const ExtensionId& extension_id) { … }
ExtensionHost* ExtensionHostRegistry::GetExtensionHostForPrimaryMainFrame(
content::RenderFrameHost* render_frame_host) { … }
void ExtensionHostRegistry::AddObserver(Observer* observer) { … }
void ExtensionHostRegistry::RemoveObserver(Observer* observer) { … }
void ExtensionHostRegistry::Shutdown() { … }
}