This source file includes following definitions.
- GetInstance
- GetForProfile
- GetBrowserContextToUse
- BuildServiceInstanceFor
#include "chrome/browser/network_time/network_time_service_factory.h"
#include "chrome/browser/network_time/network_time_service.h"
#include "chrome/browser/profiles/incognito_helpers.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
NetworkTimeServiceFactory::NetworkTimeServiceFactory()
: BrowserContextKeyedServiceFactory(
"NetworkTimeService",
BrowserContextDependencyManager::GetInstance()) {
}
NetworkTimeServiceFactory::~NetworkTimeServiceFactory() {
}
NetworkTimeServiceFactory* NetworkTimeServiceFactory::GetInstance() {
return Singleton<NetworkTimeServiceFactory>::get();
}
NetworkTimeService* NetworkTimeServiceFactory::GetForProfile(
Profile* profile) {
return static_cast<NetworkTimeService*>(
GetInstance()->GetServiceForBrowserContext(profile, true));
}
content::BrowserContext* NetworkTimeServiceFactory::GetBrowserContextToUse(
content::BrowserContext* context) const {
return chrome::GetBrowserContextRedirectedInIncognito(context);
}
KeyedService* NetworkTimeServiceFactory::BuildServiceInstanceFor(
content::BrowserContext* context) const {
return new NetworkTimeService(static_cast<Profile*>(context));
}