1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_NET_PROXY_SERVICE_FACTORY_H_
6 #define CHROME_BROWSER_NET_PROXY_SERVICE_FACTORY_H_
8 #include "base/basictypes.h"
11 class PrefProxyConfigTracker
;
16 class NetworkDelegate
;
17 class ProxyConfigService
;
19 class URLRequestContext
;
22 class ProxyServiceFactory
{
24 // Creates a ProxyConfigService that delivers the system preferences
25 // (or the respective ChromeOS equivalent).
26 static net::ProxyConfigService
* CreateProxyConfigService(
27 PrefProxyConfigTracker
* tracker
);
29 // Creates a PrefProxyConfigTracker that tracks preferences of a
30 // profile. On ChromeOS it additionaly tracks local state for shared proxy
31 // settings. This tracker should be used if the profile's preferences should
32 // be respected. On ChromeOS's signin screen this is for example not the case.
33 static PrefProxyConfigTracker
* CreatePrefProxyConfigTrackerOfProfile(
34 PrefService
* profile_prefs
,
35 PrefService
* local_state_prefs
);
37 // Creates a PrefProxyConfigTracker that tracks local state only. This tracker
38 // should be used for the system request context and the signin screen
40 static PrefProxyConfigTracker
* CreatePrefProxyConfigTrackerOfLocalState(
41 PrefService
* local_state_prefs
);
43 // Create a proxy service according to the options on command line.
44 static net::ProxyService
* CreateProxyService(
46 net::URLRequestContext
* context
,
47 net::NetworkDelegate
* network_delegate
,
48 net::ProxyConfigService
* proxy_config_service
,
49 const CommandLine
& command_line
);
52 DISALLOW_IMPLICIT_CONSTRUCTORS(ProxyServiceFactory
);
55 #endif // CHROME_BROWSER_NET_PROXY_SERVICE_FACTORY_H_