This source file includes following definitions.
- GetForBrowserContext
- GetInstance
- BuildServiceInstanceFor
- GetBrowserContextToUse
#include "extensions/browser/extension_registry_factory.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extensions_browser_client.h"
using content::BrowserContext;
namespace extensions {
ExtensionRegistry* ExtensionRegistryFactory::GetForBrowserContext(
BrowserContext* context) {
return static_cast<ExtensionRegistry*>(
GetInstance()->GetServiceForBrowserContext(context, true));
}
ExtensionRegistryFactory* ExtensionRegistryFactory::GetInstance() {
return Singleton<ExtensionRegistryFactory>::get();
}
ExtensionRegistryFactory::ExtensionRegistryFactory()
: BrowserContextKeyedServiceFactory(
"ExtensionRegistry",
BrowserContextDependencyManager::GetInstance()) {
}
ExtensionRegistryFactory::~ExtensionRegistryFactory() {}
KeyedService* ExtensionRegistryFactory::BuildServiceInstanceFor(
content::BrowserContext* context) const {
return new ExtensionRegistry;
}
BrowserContext* ExtensionRegistryFactory::GetBrowserContextToUse(
BrowserContext* context) const {
return ExtensionsBrowserClient::Get()->GetOriginalContext(context);
}
}