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"
9 #include "base/memory/scoped_ptr.h"
11 class PrefProxyConfigTracker
;
20 class NetworkDelegate
;
21 class ProxyConfigService
;
23 class URLRequestContext
;
26 class ProxyServiceFactory
{
28 // Creates a ProxyConfigService that delivers the system preferences
29 // (or the respective ChromeOS equivalent).
30 static net::ProxyConfigService
* CreateProxyConfigService(
31 PrefProxyConfigTracker
* tracker
);
33 // Creates a PrefProxyConfigTracker that tracks preferences of a
34 // profile. On ChromeOS it additionaly tracks local state for shared proxy
35 // settings. This tracker should be used if the profile's preferences should
36 // be respected. On ChromeOS's signin screen this is for example not the case.
37 static PrefProxyConfigTracker
* CreatePrefProxyConfigTrackerOfProfile(
38 PrefService
* profile_prefs
,
39 PrefService
* local_state_prefs
);
41 // Creates a PrefProxyConfigTracker that tracks local state only. This tracker
42 // should be used for the system request context and the signin screen
44 static PrefProxyConfigTracker
* CreatePrefProxyConfigTrackerOfLocalState(
45 PrefService
* local_state_prefs
);
47 // Create a proxy service according to the options on command line.
48 static scoped_ptr
<net::ProxyService
> CreateProxyService(
50 net::URLRequestContext
* context
,
51 net::NetworkDelegate
* network_delegate
,
52 net::ProxyConfigService
* proxy_config_service
,
53 const base::CommandLine
& command_line
,
54 bool quick_check_enabled
);
57 DISALLOW_IMPLICIT_CONSTRUCTORS(ProxyServiceFactory
);
60 #endif // CHROME_BROWSER_NET_PROXY_SERVICE_FACTORY_H_