Index: chrome/browser/net/proxy_service_factory.cc |
=================================================================== |
--- chrome/browser/net/proxy_service_factory.cc (revision 108608) |
+++ chrome/browser/net/proxy_service_factory.cc (working copy) |
@@ -8,7 +8,7 @@ |
#include "base/string_number_conversions.h" |
#include "chrome/browser/browser_process.h" |
#include "chrome/browser/io_thread.h" |
-#include "chrome/browser/net/pref_proxy_config_service.h" |
+#include "chrome/browser/net/pref_proxy_config_tracker.h" |
#include "chrome/common/chrome_switches.h" |
#include "content/public/browser/browser_thread.h" |
#include "net/base/net_log.h" |
@@ -19,39 +19,55 @@ |
#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) |
using content::BrowserThread; |
// 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); |
} |
+#if defined(OS_CHROMEOS) |
// static |
+chromeos::ProxyConfigServiceImpl* |
+ ProxyServiceFactory::CreatePrefProxyConfigTracker( |
+ PrefService* pref_service) { |
+ return new chromeos::ProxyConfigServiceImpl(pref_service); |
+} |
+#else |
+// static |
+PrefProxyConfigTrackerImpl* ProxyServiceFactory::CreatePrefProxyConfigTracker( |
+ PrefService* pref_service) { |
+ return new PrefProxyConfigTrackerImpl(pref_service); |
+} |
+#endif // defined(OS_CHROMEOS) |
+ |
+// static |
net::ProxyService* ProxyServiceFactory::CreateProxyService( |
net::NetLog* net_log, |
net::URLRequestContext* context, |