Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(201)

Side by Side Diff: chrome/browser/net/profile_network_context_service_factory.cc

Issue 2976323002: Hook up ProfileIOData's URLRequestContext to a NetworkService. (Closed)
Patch Set: Response to comments Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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.
39 return context;
40 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698