Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / network_time / network_time_service_factory.cc
bloba6132dc62247c3a666548023289d261e8e71d9b9
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/network_time/network_time_service_factory.h"
7 #include "chrome/browser/network_time/network_time_service.h"
8 #include "chrome/browser/profiles/incognito_helpers.h"
9 #include "components/browser_context_keyed_service/browser_context_dependency_manager.h"
11 NetworkTimeServiceFactory::NetworkTimeServiceFactory()
12 : BrowserContextKeyedServiceFactory(
13 "NetworkTimeService",
14 BrowserContextDependencyManager::GetInstance()) {
17 NetworkTimeServiceFactory::~NetworkTimeServiceFactory() {
20 // static
21 NetworkTimeServiceFactory* NetworkTimeServiceFactory::GetInstance() {
22 return Singleton<NetworkTimeServiceFactory>::get();
25 // static
26 NetworkTimeService* NetworkTimeServiceFactory::GetForProfile(
27 Profile* profile) {
28 return static_cast<NetworkTimeService*>(
29 GetInstance()->GetServiceForBrowserContext(profile, true));
32 content::BrowserContext* NetworkTimeServiceFactory::GetBrowserContextToUse(
33 content::BrowserContext* context) const {
34 return chrome::GetBrowserContextRedirectedInIncognito(context);
37 BrowserContextKeyedService*
38 NetworkTimeServiceFactory::BuildServiceInstanceFor(
39 content::BrowserContext* context) const {
40 return new NetworkTimeService(static_cast<Profile*>(context));