Chromium Code Reviews| Index: chrome/browser/net/proxy_service_factory.cc |
| =================================================================== |
| --- chrome/browser/net/proxy_service_factory.cc (revision 106059) |
| +++ chrome/browser/net/proxy_service_factory.cc (working copy) |
| @@ -7,8 +7,8 @@ |
| #include "base/command_line.h" |
| #include "base/string_number_conversions.h" |
| #include "chrome/browser/browser_process.h" |
| -#include "chrome/browser/net/pref_proxy_config_service.h" |
| #include "chrome/browser/io_thread.h" |
| +#include "chrome/browser/net/pref_proxy_config_tracker.h" |
| #include "chrome/common/chrome_switches.h" |
| #include "content/browser/browser_thread.h" |
| #include "net/base/net_log.h" |
| @@ -19,37 +19,52 @@ |
| #include "net/url_request/url_request_context.h" |
| #if defined(OS_CHROMEOS) |
| -#include "chrome/browser/chromeos/proxy_config_service.h" |
| +#include "chrome/browser/chromeos/proxy_config_service_impl.h" |
| #endif // defined(OS_CHROMEOS) |
| // static |
| -net::ProxyConfigService* ProxyServiceFactory::CreateProxyConfigService( |
| - PrefProxyConfigTracker* proxy_config_tracker) { |
| +ChromeProxyConfigService* ProxyServiceFactory::CreateProxyConfigService() { |
| // The linux gconf-based proxy settings getter relies on being initialized |
| // from the UI thread. |
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| - // Create a baseline service that provides proxy configuration in case nothing |
| - // is configured through prefs (Note: prefs include command line and |
| - // configuration policy). |
| net::ProxyConfigService* base_service = NULL; |
| +#if !defined(OS_CHROMEOS) |
| + // On ChromeOS, base service is NULL; chromeos::ProxyConfigServiceImpl |
| + // determines the effective proxy config to take effect in the network layer, |
| + // be it from prefs or system (which is network flimflam on chromeos). |
| + |
| + // For other platforms, create a baseline service that provides proxy |
| + // configuration in case nothing is configured through prefs (Note: prefs |
| + // include command line and configuration policy). |
| + |
| // TODO(port): the IO and FILE message loops are only used by Linux. Can |
| // that code be moved to chrome/browser instead of being in net, so that it |
| // can use BrowserThread instead of raw MessageLoop pointers? See bug 25354. |
| -#if defined(OS_CHROMEOS) |
| - base_service = new chromeos::ProxyConfigService( |
| - g_browser_process->chromeos_proxy_config_service_impl()); |
| -#else |
| base_service = net::ProxyService::CreateSystemProxyConfigService( |
| g_browser_process->io_thread()->message_loop(), |
| g_browser_process->file_thread()->message_loop()); |
| -#endif // defined(OS_CHROMEOS) |
| +#endif // !defined(OS_CHROMEOS) |
| - return new PrefProxyConfigService(proxy_config_tracker, base_service); |
| + return new ChromeProxyConfigService(base_service); |
| } |
| // static |
|
Mattias Nissler (ping if slow)
2011/10/19 17:03:42
I'd rather put the // static next to the declarati
kuan
2011/10/20 00:41:11
Done.
|
| +#if defined(OS_CHROMEOS) |
| +chromeos::ProxyConfigServiceImpl* |
| + ProxyServiceFactory::CreatePrefProxyConfigTracker( |
| + PrefService* pref_service) { |
| + return new chromeos::ProxyConfigServiceImpl(pref_service); |
| +} |
| +#else |
| +PrefProxyConfigTracker* ProxyServiceFactory::CreatePrefProxyConfigTracker( |
| + PrefService* pref_service) { |
| + return new PrefProxyConfigTracker(pref_service); |
| +} |
| +#endif // defined(OS_CHROMEOS) |
| + |
| +// static |
| net::ProxyService* ProxyServiceFactory::CreateProxyService( |
| net::NetLog* net_log, |
| net::URLRequestContext* context, |