proxy_service_factory.h revision 5d1f7b1de12d16ceb2c938c56701a3e8bfa558f7
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
10class CommandLine;
11class PrefProxyConfigTracker;
12class PrefService;
13
14namespace net {
15class NetLog;
16class NetworkDelegate;
17class ProxyConfigService;
18class ProxyService;
19class URLRequestContext;
20}
21
22class 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      bool quick_check_enabled);
51
52 private:
53  DISALLOW_IMPLICIT_CONSTRUCTORS(ProxyServiceFactory);
54};
55
56#endif  // CHROME_BROWSER_NET_PROXY_SERVICE_FACTORY_H_
57