#include "chrome/browser/ui/lens/lens_keyed_service_factory.h"
LensKeyedService* LensKeyedServiceFactory::GetForProfile(
Profile* profile,
bool create_if_necessary) {
return static_cast<LensKeyedService*>(
GetInstance()->GetServiceForBrowserContext(profile, create_if_necessary));
}
LensKeyedServiceFactory* LensKeyedServiceFactory::GetInstance() {
static base::NoDestructor<LensKeyedServiceFactory> instance;
return instance.get();
}
LensKeyedServiceFactory::LensKeyedServiceFactory()
: ProfileKeyedServiceFactory(
"LensKeyedService",
ProfileSelections::Builder()
.WithRegular(ProfileSelection::kRedirectedToOriginal)
.Build()) {}
std::unique_ptr<KeyedService>
LensKeyedServiceFactory::BuildServiceInstanceForBrowserContext(
content::BrowserContext* context) const {
return std::make_unique<LensKeyedService>();
}
LensKeyedServiceFactory::~LensKeyedServiceFactory() = default;
bool LensKeyedServiceFactory::ServiceIsCreatedWithBrowserContext() const {
return true;
}