diff options
author | pneubeck@chromium.org <pneubeck@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-22 10:54:11 +0000 |
---|---|---|
committer | pneubeck@chromium.org <pneubeck@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-22 10:54:11 +0000 |
commit | 53c5b0f9b688ab95b69b9d19cac5d298b71bc0d4 (patch) | |
tree | 52c8beb9c69fc02ca2bc96a1699d260780794067 /chrome | |
parent | b508e6986ea423591597825793aef914e7d7df0d (diff) | |
download | chromium_src-53c5b0f9b688ab95b69b9d19cac5d298b71bc0d4.zip chromium_src-53c5b0f9b688ab95b69b9d19cac5d298b71bc0d4.tar.gz chromium_src-53c5b0f9b688ab95b69b9d19cac5d298b71bc0d4.tar.bz2 |
Replace PrefProxyConfigTracker typedef by proper interface.
- removes the PrefProxyConfigTracker typedef which depended on compile time flags.
- PrefProxyConfigTracker is now a proper pure interface.
- removes unnecessary exposure of ChromeProxyConfigService; which is now only used in PrefProxyConfigTrackerImpl
- fixes includes where required
BUG=258835
TBR=sky@chromium.org (API usages, fixed includes)
Review URL: https://chromiumcodereview.appspot.com/18259025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212864 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
22 files changed, 101 insertions, 79 deletions
diff --git a/chrome/browser/automation/testing_automation_provider_chromeos.cc b/chrome/browser/automation/testing_automation_provider_chromeos.cc index a528098..6183395 100644 --- a/chrome/browser/automation/testing_automation_provider_chromeos.cc +++ b/chrome/browser/automation/testing_automation_provider_chromeos.cc @@ -38,6 +38,7 @@ #include "chrome/browser/chromeos/settings/cros_settings.h" #include "chrome/browser/chromeos/settings/cros_settings_names.h" #include "chrome/browser/chromeos/system/timezone_settings.h" +#include "chrome/browser/prefs/proxy_config_dictionary.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" diff --git a/chrome/browser/chromeos/login/managed/locally_managed_user_login_flow.h b/chrome/browser/chromeos/login/managed/locally_managed_user_login_flow.h index 688f07e..8a038f1 100644 --- a/chrome/browser/chromeos/login/managed/locally_managed_user_login_flow.h +++ b/chrome/browser/chromeos/login/managed/locally_managed_user_login_flow.h @@ -7,6 +7,7 @@ #include "base/basictypes.h" #include "base/compiler_specific.h" +#include "base/memory/weak_ptr.h" #include "base/strings/string16.h" #include "chrome/browser/chromeos/login/user_flow.h" diff --git a/chrome/browser/chromeos/proxy_config_service_impl_unittest.cc b/chrome/browser/chromeos/proxy_config_service_impl_unittest.cc index a0dea43..f66a0b5 100644 --- a/chrome/browser/chromeos/proxy_config_service_impl_unittest.cc +++ b/chrome/browser/chromeos/proxy_config_service_impl_unittest.cc @@ -221,14 +221,16 @@ class ProxyConfigServiceImplTest : public testing::Test { SetUpNetwork(); PrefProxyConfigTrackerImpl::RegisterPrefs(pref_service_.registry()); - proxy_config_service_.reset(new ChromeProxyConfigService(NULL)); + // Create a ProxyConfigServiceImpl like for the system request context. config_service_impl_.reset( new ProxyConfigServiceImpl(NULL, // no profile prefs &pref_service_)); - config_service_impl_->SetChromeProxyConfigService( - proxy_config_service_.get()); - // SetChromeProxyConfigService triggers update of initial prefs proxy + proxy_config_service_ = + config_service_impl_->CreateTrackingProxyConfigService( + scoped_ptr<net::ProxyConfigService>()); + + // CreateTrackingProxyConfigService triggers update of initial prefs proxy // config by tracker to chrome proxy config service, so flush all pending // tasks so that tests start fresh. loop_.RunUntilIdle(); @@ -319,7 +321,7 @@ class ProxyConfigServiceImplTest : public testing::Test { } base::MessageLoop loop_; - scoped_ptr<ChromeProxyConfigService> proxy_config_service_; + scoped_ptr<net::ProxyConfigService> proxy_config_service_; scoped_ptr<ProxyConfigServiceImpl> config_service_impl_; TestingPrefServiceSimple pref_service_; diff --git a/chrome/browser/extensions/api/preference/chrome_direct_setting_api.h b/chrome/browser/extensions/api/preference/chrome_direct_setting_api.h index 0fd6207..2b7ca28 100644 --- a/chrome/browser/extensions/api/preference/chrome_direct_setting_api.h +++ b/chrome/browser/extensions/api/preference/chrome_direct_setting_api.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_EXTENSIONS_API_PREFERENCE_CHROME_DIRECT_SETTING_API_H__ #define CHROME_BROWSER_EXTENSIONS_API_PREFERENCE_CHROME_DIRECT_SETTING_API_H__ +#include "base/prefs/pref_change_registrar.h" #include "chrome/browser/extensions/api/profile_keyed_api_factory.h" #include "chrome/browser/extensions/event_router.h" diff --git a/chrome/browser/history/web_history_service.h b/chrome/browser/history/web_history_service.h index dceb815..3a234a2 100644 --- a/chrome/browser/history/web_history_service.h +++ b/chrome/browser/history/web_history_service.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_HISTORY_WEB_HISTORY_SERVICE_H_ #define CHROME_BROWSER_HISTORY_WEB_HISTORY_SERVICE_H_ +#include "base/memory/weak_ptr.h" #include "chrome/browser/history/history_types.h" #include "chrome/browser/profiles/profile.h" #include "components/browser_context_keyed_service/browser_context_keyed_service.h" diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc index d995af3..3688996 100644 --- a/chrome/browser/io_thread.cc +++ b/chrome/browser/io_thread.cc @@ -85,10 +85,6 @@ #include "net/proxy/proxy_resolver_v8.h" #endif -#if defined(OS_CHROMEOS) -#include "chrome/browser/chromeos/proxy_config_service_impl.h" -#endif // defined(OS_CHROMEOS) - using content::BrowserThread; class SafeBrowsingURLRequestContext; @@ -915,10 +911,9 @@ void IOThread::InitSystemRequestContext() { // If we're in unit_tests, IOThread may not be run. if (!BrowserThread::IsMessageLoopValid(BrowserThread::IO)) return; - ChromeProxyConfigService* proxy_config_service = - ProxyServiceFactory::CreateProxyConfigService(); - system_proxy_config_service_.reset(proxy_config_service); - pref_proxy_config_tracker_->SetChromeProxyConfigService(proxy_config_service); + system_proxy_config_service_.reset( + ProxyServiceFactory::CreateProxyConfigService( + pref_proxy_config_tracker_.get())); system_url_request_context_getter_ = new SystemURLRequestContextGetter(this); // Safe to post an unretained this pointer, since IOThread is diff --git a/chrome/browser/io_thread.h b/chrome/browser/io_thread.h index eed9d17..4b1b9ef 100644 --- a/chrome/browser/io_thread.h +++ b/chrome/browser/io_thread.h @@ -22,7 +22,7 @@ class ChromeNetLog; class CommandLine; -class PrefProxyConfigTrackerImpl; +class PrefProxyConfigTracker; class PrefService; class PrefRegistrySimple; class SystemURLRequestContextGetter; @@ -300,7 +300,7 @@ class IOThread : public content::BrowserThreadDelegate { // which gets posted by calling certain member functions of IOThread. scoped_ptr<net::ProxyConfigService> system_proxy_config_service_; - scoped_ptr<PrefProxyConfigTrackerImpl> pref_proxy_config_tracker_; + scoped_ptr<PrefProxyConfigTracker> pref_proxy_config_tracker_; scoped_refptr<net::URLRequestContextGetter> system_url_request_context_getter_; diff --git a/chrome/browser/net/pref_proxy_config_tracker.cc b/chrome/browser/net/pref_proxy_config_tracker.cc new file mode 100644 index 0000000..f71f841 --- /dev/null +++ b/chrome/browser/net/pref_proxy_config_tracker.cc @@ -0,0 +1,11 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/net/pref_proxy_config_tracker.h" + +PrefProxyConfigTracker::PrefProxyConfigTracker() { +} + +PrefProxyConfigTracker::~PrefProxyConfigTracker() { +} diff --git a/chrome/browser/net/pref_proxy_config_tracker.h b/chrome/browser/net/pref_proxy_config_tracker.h index 97dc70e..7ce43e0 100644 --- a/chrome/browser/net/pref_proxy_config_tracker.h +++ b/chrome/browser/net/pref_proxy_config_tracker.h @@ -5,18 +5,39 @@ #ifndef CHROME_BROWSER_NET_PREF_PROXY_CONFIG_TRACKER_H_ #define CHROME_BROWSER_NET_PREF_PROXY_CONFIG_TRACKER_H_ -#include "chrome/browser/net/pref_proxy_config_tracker_impl.h" +#include "base/basictypes.h" +#include "base/memory/scoped_ptr.h" -#if defined(OS_CHROMEOS) -namespace chromeos { -class ProxyConfigServiceImpl; +namespace net { +class ProxyConfigService; } -#endif // defined(OS_CHROMEOS) -#if defined(OS_CHROMEOS) -typedef chromeos::ProxyConfigServiceImpl PrefProxyConfigTracker; -#else -typedef PrefProxyConfigTrackerImpl PrefProxyConfigTracker; -#endif // defined(OS_CHROMEOS) +// Interface for a class that tracks proxy preferences. The purpose of the +// concrete class is to track changes in the Preferences, to translates the +// preferences to net::ProxyConfig and to push the result over to a +// net::ProxyConfigService onto the IO thread. +class PrefProxyConfigTracker { + public: + PrefProxyConfigTracker(); + virtual ~PrefProxyConfigTracker(); + + // Creates a net::ProxyConfigService and keeps a pointer to it. After this + // call, this tracker forwards any changes of proxy preferences to the created + // ProxyConfigService. The returned ProxyConfigService must not be deleted + // before DetachFromPrefService was called. Takes ownership of the passed + // |base_service|, which can be NULL. This |base_service| provides the proxy + // settings of the OS (except of ChromeOS). This must be called on the + // UI thread. + virtual scoped_ptr<net::ProxyConfigService> CreateTrackingProxyConfigService( + scoped_ptr<net::ProxyConfigService> base_service) = 0; + + // Releases the PrefService passed upon construction and the |base_service| + // passed to CreateTrackingProxyConfigService. This must be called on the UI + // thread. + virtual void DetachFromPrefService() = 0; + + private: + DISALLOW_COPY_AND_ASSIGN(PrefProxyConfigTracker); +}; #endif // CHROME_BROWSER_NET_PREF_PROXY_CONFIG_TRACKER_H_ diff --git a/chrome/browser/net/pref_proxy_config_tracker_impl.cc b/chrome/browser/net/pref_proxy_config_tracker_impl.cc index 2c6318c..5dd3e5d 100644 --- a/chrome/browser/net/pref_proxy_config_tracker_impl.cc +++ b/chrome/browser/net/pref_proxy_config_tracker_impl.cc @@ -140,13 +140,17 @@ PrefProxyConfigTrackerImpl::~PrefProxyConfigTrackerImpl() { DCHECK(pref_service_ == NULL); } -void PrefProxyConfigTrackerImpl::SetChromeProxyConfigService( - ChromeProxyConfigService* chrome_proxy_config_service) { +scoped_ptr<net::ProxyConfigService> +PrefProxyConfigTrackerImpl::CreateTrackingProxyConfigService( + scoped_ptr<net::ProxyConfigService> base_service) { + chrome_proxy_config_service_ = + new ChromeProxyConfigService(base_service.release()); VLOG(1) << this << ": set chrome proxy config service to " - << chrome_proxy_config_service; - chrome_proxy_config_service_ = chrome_proxy_config_service; + << chrome_proxy_config_service_; if (chrome_proxy_config_service_ && update_pending_) OnProxyConfigChanged(config_state_, pref_config_); + + return scoped_ptr<net::ProxyConfigService>(chrome_proxy_config_service_); } void PrefProxyConfigTrackerImpl::DetachFromPrefService() { @@ -154,7 +158,7 @@ void PrefProxyConfigTrackerImpl::DetachFromPrefService() { // Stop notifications. proxy_prefs_.RemoveAll(); pref_service_ = NULL; - SetChromeProxyConfigService(NULL); + chrome_proxy_config_service_ = NULL; } // static diff --git a/chrome/browser/net/pref_proxy_config_tracker_impl.h b/chrome/browser/net/pref_proxy_config_tracker_impl.h index 0abbc99f..4e1aa00 100644 --- a/chrome/browser/net/pref_proxy_config_tracker_impl.h +++ b/chrome/browser/net/pref_proxy_config_tracker_impl.h @@ -10,6 +10,7 @@ #include "base/memory/scoped_ptr.h" #include "base/observer_list.h" #include "base/prefs/pref_change_registrar.h" +#include "chrome/browser/net/pref_proxy_config_tracker.h" #include "chrome/browser/prefs/proxy_config_dictionary.h" #include "net/proxy/proxy_config.h" #include "net/proxy/proxy_config_service.h" @@ -81,18 +82,18 @@ class ChromeProxyConfigService // A class that tracks proxy preferences. It translates the configuration // to net::ProxyConfig and pushes the result over to the IO thread for // ChromeProxyConfigService::UpdateProxyConfig to use. -class PrefProxyConfigTrackerImpl { +class PrefProxyConfigTrackerImpl : public PrefProxyConfigTracker { public: explicit PrefProxyConfigTrackerImpl(PrefService* pref_service); virtual ~PrefProxyConfigTrackerImpl(); - // Sets the proxy config service to push the preference proxy to. - void SetChromeProxyConfigService( - ChromeProxyConfigService* proxy_config_service); + // PrefProxyConfigTracker implementation: + virtual scoped_ptr<net::ProxyConfigService> CreateTrackingProxyConfigService( + scoped_ptr<net::ProxyConfigService> base_service) OVERRIDE; // Notifies the tracker that the pref service passed upon construction is // about to go away. This must be called from the UI thread. - void DetachFromPrefService(); + virtual void DetachFromPrefService() OVERRIDE; // Determines if |config_state| takes precedence regardless, which happens if // config is from policy or extension or other-precede. diff --git a/chrome/browser/net/pref_proxy_config_tracker_impl_unittest.cc b/chrome/browser/net/pref_proxy_config_tracker_impl_unittest.cc index 1313731..40a9647 100644 --- a/chrome/browser/net/pref_proxy_config_tracker_impl_unittest.cc +++ b/chrome/browser/net/pref_proxy_config_tracker_impl_unittest.cc @@ -87,11 +87,10 @@ class PrefProxyConfigTrackerImplTestBase : public TESTBASE { delegate_service_ = new TestProxyConfigService(fixed_config_, net::ProxyConfigService::CONFIG_VALID); - proxy_config_service_.reset( - new ChromeProxyConfigService(delegate_service_)); proxy_config_tracker_.reset(new PrefProxyConfigTrackerImpl(pref_service)); - proxy_config_tracker_->SetChromeProxyConfigService( - proxy_config_service_.get()); + proxy_config_service_ = + proxy_config_tracker_->CreateTrackingProxyConfigService( + scoped_ptr<net::ProxyConfigService>(delegate_service_)); // SetChromeProxyConfigService triggers update of initial prefs proxy // config by tracker to chrome proxy config service, so flush all pending // tasks so that tests start fresh. @@ -107,7 +106,7 @@ class PrefProxyConfigTrackerImplTestBase : public TESTBASE { base::MessageLoop loop_; TestProxyConfigService* delegate_service_; // weak - scoped_ptr<ChromeProxyConfigService> proxy_config_service_; + scoped_ptr<net::ProxyConfigService> proxy_config_service_; net::ProxyConfig fixed_config_; private: diff --git a/chrome/browser/net/proxy_service_factory.cc b/chrome/browser/net/proxy_service_factory.cc index 0c83d0e..ab66107 100644 --- a/chrome/browser/net/proxy_service_factory.cc +++ b/chrome/browser/net/proxy_service_factory.cc @@ -9,7 +9,7 @@ #include "base/threading/thread.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/io_thread.h" -#include "chrome/browser/net/pref_proxy_config_tracker.h" +#include "chrome/browser/net/pref_proxy_config_tracker_impl.h" #include "chrome/common/chrome_switches.h" #include "content/public/browser/browser_thread.h" #include "net/base/net_log.h" @@ -27,12 +27,13 @@ using content::BrowserThread; // static -ChromeProxyConfigService* ProxyServiceFactory::CreateProxyConfigService() { +net::ProxyConfigService* ProxyServiceFactory::CreateProxyConfigService( + PrefProxyConfigTracker* tracker) { // The linux gconf-based proxy settings getter relies on being initialized // from the UI thread. DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - net::ProxyConfigService* base_service = NULL; + scoped_ptr<net::ProxyConfigService> base_service; #if !defined(OS_CHROMEOS) // On ChromeOS, base service is NULL; chromeos::ProxyConfigServiceImpl @@ -46,12 +47,13 @@ ChromeProxyConfigService* ProxyServiceFactory::CreateProxyConfigService() { // 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. - base_service = net::ProxyService::CreateSystemProxyConfigService( + base_service.reset(net::ProxyService::CreateSystemProxyConfigService( BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO).get(), - BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::FILE)); + BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::FILE))); #endif // !defined(OS_CHROMEOS) - return new ChromeProxyConfigService(base_service); + return tracker->CreateTrackingProxyConfigService(base_service.Pass()) + .release(); } // static diff --git a/chrome/browser/net/proxy_service_factory.h b/chrome/browser/net/proxy_service_factory.h index 154f5e9..f16e226 100644 --- a/chrome/browser/net/proxy_service_factory.h +++ b/chrome/browser/net/proxy_service_factory.h @@ -7,38 +7,24 @@ #include "base/basictypes.h" -class ChromeProxyConfigService; class CommandLine; -class PrefProxyConfigTrackerImpl; +class PrefProxyConfigTracker; class PrefService; -#if defined(OS_CHROMEOS) -namespace chromeos { -class ProxyConfigServiceImpl; -} -#endif // defined(OS_CHROMEOS) - -#if defined(OS_CHROMEOS) -typedef chromeos::ProxyConfigServiceImpl PrefProxyConfigTracker; -#else -typedef PrefProxyConfigTrackerImpl PrefProxyConfigTracker; -#endif // defined(OS_CHROMEOS) - namespace net { class NetLog; class NetworkDelegate; class ProxyConfigService; class ProxyService; class URLRequestContext; -} // namespace net +} class ProxyServiceFactory { public: // Creates a ProxyConfigService that delivers the system preferences // (or the respective ChromeOS equivalent). - // The ChromeProxyConfigService returns "pending" until it has been informed - // about the proxy configuration by calling its UpdateProxyConfig method. - static ChromeProxyConfigService* CreateProxyConfigService(); + static net::ProxyConfigService* CreateProxyConfigService( + PrefProxyConfigTracker* tracker); // Creates a PrefProxyConfigTracker that tracks preferences of a // profile. On ChromeOS it additionaly tracks local state for shared proxy diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc index b606a80..9a08d81 100644 --- a/chrome/browser/prefs/browser_prefs.cc +++ b/chrome/browser/prefs/browser_prefs.cc @@ -42,6 +42,7 @@ #include "chrome/browser/net/http_server_properties_manager.h" #include "chrome/browser/net/net_pref_observer.h" #include "chrome/browser/net/predictor.h" +#include "chrome/browser/net/pref_proxy_config_tracker_impl.h" #include "chrome/browser/net/ssl_config_service_manager.h" #include "chrome/browser/notifications/desktop_notification_service.h" #include "chrome/browser/notifications/notification_prefs_manager.h" diff --git a/chrome/browser/profiles/off_the_record_profile_impl.cc b/chrome/browser/profiles/off_the_record_profile_impl.cc index 931ed9a..3228c41 100644 --- a/chrome/browser/profiles/off_the_record_profile_impl.cc +++ b/chrome/browser/profiles/off_the_record_profile_impl.cc @@ -28,6 +28,7 @@ #include "chrome/browser/geolocation/chrome_geolocation_permission_context.h" #include "chrome/browser/geolocation/chrome_geolocation_permission_context_factory.h" #include "chrome/browser/io_thread.h" +#include "chrome/browser/net/pref_proxy_config_tracker.h" #include "chrome/browser/net/proxy_service_factory.h" #include "chrome/browser/plugins/chrome_plugin_service_filter.h" #include "chrome/browser/plugins/plugin_prefs.h" @@ -54,13 +55,13 @@ #include "webkit/browser/database/database_tracker.h" #if defined(OS_ANDROID) || defined(OS_IOS) +#include "chrome/browser/prefs/proxy_prefs.h" #include "chrome/browser/prefs/scoped_user_pref_update.h" #endif // defined(OS_ANDROID) || defined(OS_IOS) #if defined(OS_CHROMEOS) #include "chrome/browser/chromeos/preferences.h" #include "chrome/browser/chromeos/profiles/profile_helper.h" -#include "chrome/browser/chromeos/proxy_config_service_impl.h" #endif using content::BrowserThread; diff --git a/chrome/browser/profiles/profile.h b/chrome/browser/profiles/profile.h index 19a232a9..1e5270b 100644 --- a/chrome/browser/profiles/profile.h +++ b/chrome/browser/profiles/profile.h @@ -12,7 +12,6 @@ #include "base/basictypes.h" #include "base/containers/hash_tables.h" #include "base/logging.h" -#include "chrome/browser/net/pref_proxy_config_tracker.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/content_browser_client.h" #include "net/url_request/url_request_job_factory.h" @@ -23,6 +22,8 @@ class ExtensionSpecialStoragePolicy; class FaviconService; class HostContentSettingsMap; class PasswordStore; +class PrefProxyConfigTracker; +class PrefService; class PromoCounter; class ProtocolHandlerRegistry; class TestingProfile; diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc index b4ef81e..57ffb8f 100644 --- a/chrome/browser/profiles/profile_impl.cc +++ b/chrome/browser/profiles/profile_impl.cc @@ -48,6 +48,7 @@ #include "chrome/browser/net/chrome_url_request_context.h" #include "chrome/browser/net/net_pref_observer.h" #include "chrome/browser/net/predictor.h" +#include "chrome/browser/net/pref_proxy_config_tracker.h" #include "chrome/browser/net/proxy_service_factory.h" #include "chrome/browser/net/ssl_config_service_manager.h" #include "chrome/browser/net/url_fixer_upper.h" @@ -104,7 +105,6 @@ #include "chrome/browser/chromeos/login/user_manager.h" #include "chrome/browser/chromeos/preferences.h" #include "chrome/browser/chromeos/profiles/profile_helper.h" -#include "chrome/browser/chromeos/proxy_config_service_impl.h" #endif #if defined(ENABLE_CONFIGURATION_POLICY) diff --git a/chrome/browser/profiles/profile_io_data.cc b/chrome/browser/profiles/profile_io_data.cc index c2677bf..e7b2cfb 100644 --- a/chrome/browser/profiles/profile_io_data.cc +++ b/chrome/browser/profiles/profile_io_data.cc @@ -86,7 +86,6 @@ #if defined(OS_CHROMEOS) #include "chrome/browser/chromeos/drive/drive_protocol_handler.h" #include "chrome/browser/chromeos/policy/policy_cert_verifier.h" -#include "chrome/browser/chromeos/proxy_config_service_impl.h" #include "chrome/browser/chromeos/settings/cros_settings.h" #include "chrome/browser/chromeos/settings/cros_settings_names.h" #include "chrome/browser/policy/browser_policy_connector.h" @@ -261,11 +260,9 @@ void ProfileIOData::InitializeOnUIThread(Profile* profile) { params->protocol_handler_interceptor = protocol_handler_registry->CreateJobInterceptorFactory(); - ChromeProxyConfigService* proxy_config_service = - ProxyServiceFactory::CreateProxyConfigService(); - params->proxy_config_service.reset(proxy_config_service); - profile->GetProxyConfigTracker()->SetChromeProxyConfigService( - proxy_config_service); + params->proxy_config_service + .reset(ProxyServiceFactory::CreateProxyConfigService( + profile->GetProxyConfigTracker())); #if defined(ENABLE_MANAGED_USERS) ManagedUserService* managed_user_service = ManagedUserServiceFactory::GetForProfile(profile); diff --git a/chrome/browser/ui/webui/options/browser_options_handler.h b/chrome/browser/ui/webui/options/browser_options_handler.h index a9173f8..06199f0 100644 --- a/chrome/browser/ui/webui/options/browser_options_handler.h +++ b/chrome/browser/ui/webui/options/browser_options_handler.h @@ -10,6 +10,7 @@ #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" +#include "base/prefs/pref_change_registrar.h" #include "base/prefs/pref_member.h" #include "base/time/time.h" #include "chrome/browser/profiles/profile.h" @@ -24,8 +25,6 @@ #if defined(OS_CHROMEOS) #include "chrome/browser/chromeos/system/pointer_device_observer.h" -#else -#include "base/prefs/pref_change_registrar.h" #endif // defined(OS_CHROMEOS) class AutocompleteController; diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index fbf6e0c..8cb25d4 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -1119,6 +1119,7 @@ 'browser/net/preconnect.h', 'browser/net/predictor.cc', 'browser/net/predictor.h', + 'browser/net/pref_proxy_config_tracker.cc', 'browser/net/pref_proxy_config_tracker.h', 'browser/net/pref_proxy_config_tracker_impl.cc', 'browser/net/pref_proxy_config_tracker_impl.h', diff --git a/chrome/test/base/testing_profile.cc b/chrome/test/base/testing_profile.cc index e358998..2704bc7 100644 --- a/chrome/test/base/testing_profile.cc +++ b/chrome/test/base/testing_profile.cc @@ -37,6 +37,7 @@ #include "chrome/browser/history/shortcuts_backend_factory.h" #include "chrome/browser/history/top_sites.h" #include "chrome/browser/history/web_history_service_factory.h" +#include "chrome/browser/net/pref_proxy_config_tracker.h" #include "chrome/browser/net/proxy_service_factory.h" #include "chrome/browser/notifications/desktop_notification_service.h" #include "chrome/browser/notifications/desktop_notification_service_factory.h" @@ -79,10 +80,6 @@ #include "chrome/browser/policy/policy_service_stub.h" #endif // defined(ENABLE_CONFIGURATION_POLICY) -#if defined(OS_CHROMEOS) -#include "chrome/browser/chromeos/proxy_config_service_impl.h" -#endif // defined(OS_CHROMEOS) - using base::Time; using content::BrowserThread; using content::DownloadManagerDelegate; |