OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "chrome/browser/net/proxy_service_factory.h" | 5 #include "chrome/browser/net/proxy_service_factory.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 | 45 |
46 #if !defined(OS_CHROMEOS) | 46 #if !defined(OS_CHROMEOS) |
47 // On ChromeOS, base service is NULL; chromeos::ProxyConfigServiceImpl | 47 // On ChromeOS, base service is NULL; chromeos::ProxyConfigServiceImpl |
48 // determines the effective proxy config to take effect in the network layer, | 48 // determines the effective proxy config to take effect in the network layer, |
49 // be it from prefs or system (which is network shill on chromeos). | 49 // be it from prefs or system (which is network shill on chromeos). |
50 | 50 |
51 // For other platforms, create a baseline service that provides proxy | 51 // For other platforms, create a baseline service that provides proxy |
52 // configuration in case nothing is configured through prefs (Note: prefs | 52 // configuration in case nothing is configured through prefs (Note: prefs |
53 // include command line and configuration policy). | 53 // include command line and configuration policy). |
54 | 54 |
55 // TODO(port): the IO and FILE message loops are only used by Linux. Can | |
56 // that code be moved to chrome/browser instead of being in net, so that it | |
57 // can use BrowserThread instead of raw MessageLoop pointers? See bug 25354. | |
58 base_service = net::ProxyService::CreateSystemProxyConfigService( | 55 base_service = net::ProxyService::CreateSystemProxyConfigService( |
59 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO), | 56 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); |
60 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE)); | |
61 #endif // !defined(OS_CHROMEOS) | 57 #endif // !defined(OS_CHROMEOS) |
62 | 58 |
63 return tracker->CreateTrackingProxyConfigService(std::move(base_service)); | 59 return tracker->CreateTrackingProxyConfigService(std::move(base_service)); |
64 } | 60 } |
65 | 61 |
66 // static | 62 // static |
67 PrefProxyConfigTracker* | 63 PrefProxyConfigTracker* |
68 ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( | 64 ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( |
69 PrefService* profile_prefs, | 65 PrefService* profile_prefs, |
70 PrefService* local_state_prefs) { | 66 PrefService* local_state_prefs) { |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 } | 131 } |
136 | 132 |
137 proxy_service->set_quick_check_enabled(quick_check_enabled); | 133 proxy_service->set_quick_check_enabled(quick_check_enabled); |
138 proxy_service->set_sanitize_url_policy( | 134 proxy_service->set_sanitize_url_policy( |
139 pac_https_url_stripping_enabled | 135 pac_https_url_stripping_enabled |
140 ? net::ProxyService::SanitizeUrlPolicy::SAFE | 136 ? net::ProxyService::SanitizeUrlPolicy::SAFE |
141 : net::ProxyService::SanitizeUrlPolicy::UNSAFE); | 137 : net::ProxyService::SanitizeUrlPolicy::UNSAFE); |
142 | 138 |
143 return proxy_service; | 139 return proxy_service; |
144 } | 140 } |
OLD | NEW |