#include "chrome/browser/extensions/chrome_app_icon_service_factory.h"
#include "chrome/browser/extensions/chrome_app_icon_service.h"
#include "extensions/browser/extension_registry_factory.h"
#include "extensions/buildflags/buildflags.h"
static_assert(BUILDFLAG(ENABLE_EXTENSIONS_CORE));
namespace extensions {
ChromeAppIconService* ChromeAppIconServiceFactory::GetForBrowserContext(
content::BrowserContext* context) {
return static_cast<ChromeAppIconService*>(
GetInstance()->GetServiceForBrowserContext(context, true));
}
ChromeAppIconServiceFactory* ChromeAppIconServiceFactory::GetInstance() {
static base::NoDestructor<ChromeAppIconServiceFactory> instance;
return instance.get();
}
ChromeAppIconServiceFactory::ChromeAppIconServiceFactory()
: ProfileKeyedServiceFactory(
"ChromeAppIconService",
ProfileSelections::Builder()
.WithRegular(ProfileSelection::kRedirectedToOriginal)
.WithGuest(ProfileSelection::kRedirectedToOriginal)
.WithAshInternals(ProfileSelection::kRedirectedToOriginal)
.Build()) {
DependsOn(ExtensionRegistryFactory::GetInstance());
}
ChromeAppIconServiceFactory::~ChromeAppIconServiceFactory() = default;
std::unique_ptr<KeyedService>
ChromeAppIconServiceFactory::BuildServiceInstanceForBrowserContext(
content::BrowserContext* context) const {
return std::make_unique<ChromeAppIconService>(context);
}
}