- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / browser / net / proxy_service_factory.h
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.
4
5 #ifndef CHROME_BROWSER_NET_PROXY_SERVICE_FACTORY_H_
6 #define CHROME_BROWSER_NET_PROXY_SERVICE_FACTORY_H_
7
8 #include "base/basictypes.h"
9
10 class CommandLine;
11 class PrefProxyConfigTracker;
12 class PrefService;
13
14 namespace net {
15 class NetLog;
16 class NetworkDelegate;
17 class ProxyConfigService;
18 class ProxyService;
19 class URLRequestContext;
20 }
21
22 class ProxyServiceFactory {
23  public:
24   // Creates a ProxyConfigService that delivers the system preferences
25   // (or the respective ChromeOS equivalent).
26   static net::ProxyConfigService* CreateProxyConfigService(
27       PrefProxyConfigTracker* tracker);
28
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);
36
37   // Creates a PrefProxyConfigTracker that tracks local state only. This tracker
38   // should be used for the system request context and the signin screen
39   // (ChromeOS only).
40   static PrefProxyConfigTracker* CreatePrefProxyConfigTrackerOfLocalState(
41       PrefService* local_state_prefs);
42
43   // Create a proxy service according to the options on command line.
44   static net::ProxyService* CreateProxyService(
45       net::NetLog* net_log,
46       net::URLRequestContext* context,
47       net::NetworkDelegate* network_delegate,
48       net::ProxyConfigService* proxy_config_service,
49       const CommandLine& command_line);
50
51  private:
52   DISALLOW_IMPLICIT_CONSTRUCTORS(ProxyServiceFactory);
53 };
54
55 #endif  // CHROME_BROWSER_NET_PROXY_SERVICE_FACTORY_H_