OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_NET_PROXY_SERVICE_FACTORY_H_ | 5 #ifndef CHROME_BROWSER_NET_PROXY_SERVICE_FACTORY_H_ |
6 #define CHROME_BROWSER_NET_PROXY_SERVICE_FACTORY_H_ | 6 #define CHROME_BROWSER_NET_PROXY_SERVICE_FACTORY_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 | 11 |
12 class PrefProxyConfigTracker; | 12 class PrefProxyConfigTracker; |
13 class PrefService; | 13 class PrefService; |
14 | 14 |
15 namespace base { | |
16 class CommandLine; | |
17 } | |
18 | |
19 namespace net { | 15 namespace net { |
20 class NetLog; | |
21 class NetworkDelegate; | |
22 class ProxyConfigService; | 16 class ProxyConfigService; |
23 class ProxyService; | |
24 class URLRequestContext; | |
25 } | 17 } |
26 | 18 |
27 class ProxyServiceFactory { | 19 class ProxyServiceFactory { |
28 public: | 20 public: |
29 // Creates a ProxyConfigService that delivers the system preferences | 21 // Creates a ProxyConfigService that delivers the system preferences |
30 // (or the respective ChromeOS equivalent). | 22 // (or the respective ChromeOS equivalent). |
31 static std::unique_ptr<net::ProxyConfigService> CreateProxyConfigService( | 23 static std::unique_ptr<net::ProxyConfigService> CreateProxyConfigService( |
32 PrefProxyConfigTracker* tracker); | 24 PrefProxyConfigTracker* tracker); |
33 | 25 |
34 // Creates a PrefProxyConfigTracker that tracks preferences of a | 26 // Creates a PrefProxyConfigTracker that tracks preferences of a |
35 // profile. On ChromeOS it additionaly tracks local state for shared proxy | 27 // profile. On ChromeOS it additionaly tracks local state for shared proxy |
36 // settings. This tracker should be used if the profile's preferences should | 28 // settings. This tracker should be used if the profile's preferences should |
37 // be respected. On ChromeOS's signin screen this is for example not the case. | 29 // be respected. On ChromeOS's signin screen this is for example not the case. |
38 static PrefProxyConfigTracker* CreatePrefProxyConfigTrackerOfProfile( | 30 static PrefProxyConfigTracker* CreatePrefProxyConfigTrackerOfProfile( |
39 PrefService* profile_prefs, | 31 PrefService* profile_prefs, |
40 PrefService* local_state_prefs); | 32 PrefService* local_state_prefs); |
41 | 33 |
42 // Creates a PrefProxyConfigTracker that tracks local state only. This tracker | 34 // Creates a PrefProxyConfigTracker that tracks local state only. This tracker |
43 // should be used for the system request context and the signin screen | 35 // should be used for the system request context and the signin screen |
44 // (ChromeOS only). | 36 // (ChromeOS only). |
45 static PrefProxyConfigTracker* CreatePrefProxyConfigTrackerOfLocalState( | 37 static PrefProxyConfigTracker* CreatePrefProxyConfigTrackerOfLocalState( |
46 PrefService* local_state_prefs); | 38 PrefService* local_state_prefs); |
47 | 39 |
48 // Create a proxy service according to the options on command line. | |
49 static std::unique_ptr<net::ProxyService> CreateProxyService( | |
50 net::NetLog* net_log, | |
51 net::URLRequestContext* context, | |
52 net::NetworkDelegate* network_delegate, | |
53 std::unique_ptr<net::ProxyConfigService> proxy_config_service, | |
54 const base::CommandLine& command_line, | |
55 bool quick_check_enabled, | |
56 bool pac_https_url_stripping_enabled); | |
57 | |
58 private: | 40 private: |
59 DISALLOW_IMPLICIT_CONSTRUCTORS(ProxyServiceFactory); | 41 DISALLOW_IMPLICIT_CONSTRUCTORS(ProxyServiceFactory); |
60 }; | 42 }; |
61 | 43 |
62 #endif // CHROME_BROWSER_NET_PROXY_SERVICE_FACTORY_H_ | 44 #endif // CHROME_BROWSER_NET_PROXY_SERVICE_FACTORY_H_ |
OLD | NEW |