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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 | 10 |
11 class PrefProxyConfigTracker; | 11 class PrefProxyConfigTracker; |
12 class PrefService; | 12 class PrefService; |
13 | 13 |
14 namespace base { | 14 namespace base { |
15 class CommandLine; | 15 class CommandLine; |
16 } | 16 } |
17 | 17 |
18 namespace net { | 18 namespace net { |
19 class NetLog; | 19 class NetLog; |
20 class NetworkDelegate; | 20 class NetworkDelegate; |
21 class ProxyConfigService; | 21 class ProxyConfigService; |
22 class ProxyService; | 22 class ProxyService; |
23 class URLRequestContext; | 23 class URLRequestContext; |
24 } | 24 } |
25 | 25 |
26 class ProxyServiceFactory { | 26 class ProxyServiceFactory { |
27 public: | 27 public: |
28 // Creates a ProxyConfigService that delivers the system preferences | 28 // Creates a ProxyConfigService that delivers the system preferences |
29 // (or the respective ChromeOS equivalent). | 29 // (or the respective ChromeOS equivalent). |
30 static net::ProxyConfigService* CreateProxyConfigService( | 30 static scoped_ptr<net::ProxyConfigService> CreateProxyConfigService( |
31 PrefProxyConfigTracker* tracker); | 31 PrefProxyConfigTracker* tracker); |
32 | 32 |
33 // Creates a PrefProxyConfigTracker that tracks preferences of a | 33 // Creates a PrefProxyConfigTracker that tracks preferences of a |
34 // profile. On ChromeOS it additionaly tracks local state for shared proxy | 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 | 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. | 36 // be respected. On ChromeOS's signin screen this is for example not the case. |
37 static PrefProxyConfigTracker* CreatePrefProxyConfigTrackerOfProfile( | 37 static PrefProxyConfigTracker* CreatePrefProxyConfigTrackerOfProfile( |
38 PrefService* profile_prefs, | 38 PrefService* profile_prefs, |
39 PrefService* local_state_prefs); | 39 PrefService* local_state_prefs); |
40 | 40 |
41 // Creates a PrefProxyConfigTracker that tracks local state only. This tracker | 41 // Creates a PrefProxyConfigTracker that tracks local state only. This tracker |
42 // should be used for the system request context and the signin screen | 42 // should be used for the system request context and the signin screen |
43 // (ChromeOS only). | 43 // (ChromeOS only). |
44 static PrefProxyConfigTracker* CreatePrefProxyConfigTrackerOfLocalState( | 44 static PrefProxyConfigTracker* CreatePrefProxyConfigTrackerOfLocalState( |
45 PrefService* local_state_prefs); | 45 PrefService* local_state_prefs); |
46 | 46 |
47 // Create a proxy service according to the options on command line. | 47 // Create a proxy service according to the options on command line. |
48 static scoped_ptr<net::ProxyService> CreateProxyService( | 48 static scoped_ptr<net::ProxyService> CreateProxyService( |
49 net::NetLog* net_log, | 49 net::NetLog* net_log, |
50 net::URLRequestContext* context, | 50 net::URLRequestContext* context, |
51 net::NetworkDelegate* network_delegate, | 51 net::NetworkDelegate* network_delegate, |
52 net::ProxyConfigService* proxy_config_service, | 52 scoped_ptr<net::ProxyConfigService> proxy_config_service, |
53 const base::CommandLine& command_line, | 53 const base::CommandLine& command_line, |
54 bool quick_check_enabled); | 54 bool quick_check_enabled); |
55 | 55 |
56 private: | 56 private: |
57 DISALLOW_IMPLICIT_CONSTRUCTORS(ProxyServiceFactory); | 57 DISALLOW_IMPLICIT_CONSTRUCTORS(ProxyServiceFactory); |
58 }; | 58 }; |
59 | 59 |
60 #endif // CHROME_BROWSER_NET_PROXY_SERVICE_FACTORY_H_ | 60 #endif // CHROME_BROWSER_NET_PROXY_SERVICE_FACTORY_H_ |
OLD | NEW |