| 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 #include "chrome/browser/net/proxy_service_factory.h" | 5 #include "chrome/browser/net/proxy_service_factory.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/io_thread.h" | 10 #include "chrome/browser/io_thread.h" |
| 11 #include "chrome/browser/net/pref_proxy_config_service.h" | 11 #include "chrome/browser/net/pref_proxy_config_service.h" |
| 12 #include "chrome/common/chrome_switches.h" | 12 #include "chrome/common/chrome_switches.h" |
| 13 #include "content/public/browser/browser_thread.h" | 13 #include "content/public/browser/browser_thread.h" |
| 14 #include "net/base/net_log.h" | 14 #include "net/base/net_log.h" |
| 15 #include "net/proxy/dhcp_proxy_script_fetcher_factory.h" | 15 #include "net/proxy/dhcp_proxy_script_fetcher_factory.h" |
| 16 #include "net/proxy/proxy_config_service.h" | 16 #include "net/proxy/proxy_config_service.h" |
| 17 #include "net/proxy/proxy_script_fetcher_impl.h" | 17 #include "net/proxy/proxy_script_fetcher_impl.h" |
| 18 #include "net/proxy/proxy_service.h" | 18 #include "net/proxy/proxy_service.h" |
| 19 #include "net/url_request/url_request_context.h" | 19 #include "net/url_request/url_request_context.h" |
| 20 | 20 |
| 21 #if defined(OS_CHROMEOS) | 21 #if defined(OS_CHROMEOS) |
| 22 #include "chrome/browser/chromeos/proxy_config_service.h" | 22 #include "chrome/browser/chromeos/proxy_config_service.h" |
| 23 #endif // defined(OS_CHROMEOS) | 23 #endif // defined(OS_CHROMEOS) |
| 24 | 24 |
| 25 using content::BrowserThread; |
| 26 |
| 25 // static | 27 // static |
| 26 net::ProxyConfigService* ProxyServiceFactory::CreateProxyConfigService( | 28 net::ProxyConfigService* ProxyServiceFactory::CreateProxyConfigService( |
| 27 PrefProxyConfigTracker* proxy_config_tracker) { | 29 PrefProxyConfigTracker* proxy_config_tracker) { |
| 28 // The linux gconf-based proxy settings getter relies on being initialized | 30 // The linux gconf-based proxy settings getter relies on being initialized |
| 29 // from the UI thread. | 31 // from the UI thread. |
| 30 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 32 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 31 | 33 |
| 32 // Create a baseline service that provides proxy configuration in case nothing | 34 // Create a baseline service that provides proxy configuration in case nothing |
| 33 // is configured through prefs (Note: prefs include command line and | 35 // is configured through prefs (Note: prefs include command line and |
| 34 // configuration policy). | 36 // configuration policy). |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 context->network_delegate()); | 100 context->network_delegate()); |
| 99 } else { | 101 } else { |
| 100 proxy_service = net::ProxyService::CreateUsingSystemProxyResolver( | 102 proxy_service = net::ProxyService::CreateUsingSystemProxyResolver( |
| 101 proxy_config_service, | 103 proxy_config_service, |
| 102 num_pac_threads, | 104 num_pac_threads, |
| 103 net_log); | 105 net_log); |
| 104 } | 106 } |
| 105 | 107 |
| 106 return proxy_service; | 108 return proxy_service; |
| 107 } | 109 } |
| OLD | NEW |