Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 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. | |
| 4 | |
| 5 #include "chrome/browser/net/profile_network_context_service_factory.h" | |
| 6 | |
| 7 #include "chrome/browser/net/profile_network_context_service.h" | |
| 8 #include "chrome/browser/profiles/profile.h" | |
| 9 #include "components/keyed_service/content/browser_context_dependency_manager.h" | |
| 10 | |
| 11 ProfileNetworkContextService* | |
| 12 ProfileNetworkContextServiceFactory::GetForContext( | |
| 13 content::BrowserContext* browser_context) { | |
| 14 return static_cast<ProfileNetworkContextService*>( | |
| 15 GetInstance()->GetServiceForBrowserContext(browser_context, true)); | |
| 16 } | |
| 17 | |
| 18 ProfileNetworkContextServiceFactory* | |
| 19 ProfileNetworkContextServiceFactory::GetInstance() { | |
| 20 return base::Singleton<ProfileNetworkContextServiceFactory>::get(); | |
| 21 } | |
| 22 | |
| 23 ProfileNetworkContextServiceFactory::ProfileNetworkContextServiceFactory() | |
| 24 : BrowserContextKeyedServiceFactory( | |
| 25 "ProfileNetworkContextService", | |
| 26 BrowserContextDependencyManager::GetInstance()) {} | |
| 27 | |
| 28 ProfileNetworkContextServiceFactory::~ProfileNetworkContextServiceFactory() {} | |
| 29 | |
| 30 KeyedService* ProfileNetworkContextServiceFactory::BuildServiceInstanceFor( | |
| 31 content::BrowserContext* profile) const { | |
| 32 return new ProfileNetworkContextService(Profile::FromBrowserContext(profile)); | |
| 33 } | |
| 34 | |
| 35 content::BrowserContext* | |
| 36 ProfileNetworkContextServiceFactory::GetBrowserContextToUse( | |
| 37 content::BrowserContext* context) const { | |
| 38 // Create separate service for incognito profiles. | |
|
Randy Smith (Not in Mondays)
2017/07/19 19:31:10
Is this a TODO?
mmenke
2017/07/19 20:35:38
No, that's what this line of code does. The defau
| |
| 39 return context; | |
| 40 } | |
| OLD | NEW |