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 |
15 namespace net { | 19 namespace net { |
| 20 class NetLog; |
| 21 class NetworkDelegate; |
16 class ProxyConfigService; | 22 class ProxyConfigService; |
| 23 class ProxyService; |
| 24 class URLRequestContext; |
17 } | 25 } |
18 | 26 |
19 class ProxyServiceFactory { | 27 class ProxyServiceFactory { |
20 public: | 28 public: |
21 // Creates a ProxyConfigService that delivers the system preferences | 29 // Creates a ProxyConfigService that delivers the system preferences |
22 // (or the respective ChromeOS equivalent). | 30 // (or the respective ChromeOS equivalent). |
23 static std::unique_ptr<net::ProxyConfigService> CreateProxyConfigService( | 31 static std::unique_ptr<net::ProxyConfigService> CreateProxyConfigService( |
24 PrefProxyConfigTracker* tracker); | 32 PrefProxyConfigTracker* tracker); |
25 | 33 |
26 // Creates a PrefProxyConfigTracker that tracks preferences of a | 34 // Creates a PrefProxyConfigTracker that tracks preferences of a |
27 // profile. On ChromeOS it additionaly tracks local state for shared proxy | 35 // profile. On ChromeOS it additionaly tracks local state for shared proxy |
28 // settings. This tracker should be used if the profile's preferences should | 36 // settings. This tracker should be used if the profile's preferences should |
29 // be respected. On ChromeOS's signin screen this is for example not the case. | 37 // be respected. On ChromeOS's signin screen this is for example not the case. |
30 static PrefProxyConfigTracker* CreatePrefProxyConfigTrackerOfProfile( | 38 static PrefProxyConfigTracker* CreatePrefProxyConfigTrackerOfProfile( |
31 PrefService* profile_prefs, | 39 PrefService* profile_prefs, |
32 PrefService* local_state_prefs); | 40 PrefService* local_state_prefs); |
33 | 41 |
34 // Creates a PrefProxyConfigTracker that tracks local state only. This tracker | 42 // Creates a PrefProxyConfigTracker that tracks local state only. This tracker |
35 // should be used for the system request context and the signin screen | 43 // should be used for the system request context and the signin screen |
36 // (ChromeOS only). | 44 // (ChromeOS only). |
37 static PrefProxyConfigTracker* CreatePrefProxyConfigTrackerOfLocalState( | 45 static PrefProxyConfigTracker* CreatePrefProxyConfigTrackerOfLocalState( |
38 PrefService* local_state_prefs); | 46 PrefService* local_state_prefs); |
39 | 47 |
| 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 |
40 private: | 58 private: |
41 DISALLOW_IMPLICIT_CONSTRUCTORS(ProxyServiceFactory); | 59 DISALLOW_IMPLICIT_CONSTRUCTORS(ProxyServiceFactory); |
42 }; | 60 }; |
43 | 61 |
44 #endif // CHROME_BROWSER_NET_PROXY_SERVICE_FACTORY_H_ | 62 #endif // CHROME_BROWSER_NET_PROXY_SERVICE_FACTORY_H_ |
OLD | NEW |