Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Unified Diff: chrome/browser/chromeos/proxy_config_service_impl.cc

Issue 11345008: Remove content::NotificationObserver dependency from most Prefs code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix PrefNotifierImpl Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/proxy_config_service_impl.cc
diff --git a/chrome/browser/chromeos/proxy_config_service_impl.cc b/chrome/browser/chromeos/proxy_config_service_impl.cc
index 03228db25d8021faa523e7b5d9f7ced8f85d7fa1..f9021f02a985ebc33e3163058fdfde7e72a8d848 100644
--- a/chrome/browser/chromeos/proxy_config_service_impl.cc
+++ b/chrome/browser/chromeos/proxy_config_service_impl.cc
@@ -572,29 +572,22 @@ void ProxyConfigServiceImpl::RegisterPrefs(PrefService* pref_service) {
//------------------ ProxyConfigServiceImpl: private methods -------------------
-void ProxyConfigServiceImpl::Observe(
- int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) {
- if (type == chrome::NOTIFICATION_PREF_CHANGED &&
- *(content::Details<std::string>(details).ptr()) ==
- prefs::kUseSharedProxies) {
- if (content::Source<PrefService>(source).ptr() == prefs()) {
- VLOG(1) << "New use-shared-proxies = " << GetUseSharedProxies();
- // Determine new proxy config which may have changed because of new
- // use-shared-proxies. If necessary, activate it.
- Network* network = NULL;
- if (!active_network_.empty()) {
- network = CrosLibrary::Get()->GetNetworkLibrary()->FindNetworkByPath(
- active_network_);
- if (!network)
- LOG(WARNING) << "Can't find requested network " << active_network_;
- }
- DetermineEffectiveConfig(network, true);
- }
- return;
+void ProxyConfigServiceImpl::OnPreferenceChanged(PrefServiceBase* service,
+ const std::string& pref_name) {
+ DCHECK(service == prefs());
+ DCHECK(pref_name == prefs::kUseSharedProxies);
+ VLOG(1) << "New use-shared-proxies = " << GetUseSharedProxies();
+
+ // Determine new proxy config which may have changed because of new
+ // use-shared-proxies. If necessary, activate it.
+ Network* network = NULL;
+ if (!active_network_.empty()) {
+ network = CrosLibrary::Get()->GetNetworkLibrary()->FindNetworkByPath(
+ active_network_);
+ if (!network)
+ LOG(WARNING) << "Can't find requested network " << active_network_;
}
- PrefProxyConfigTrackerImpl::Observe(type, source, details);
Mattias Nissler (ping if slow) 2012/10/31 13:29:35 I think this breaks, the parent class also needs t
Jói 2012/10/31 14:56:26 You're right, this was caught by a tryjob and is f
+ DetermineEffectiveConfig(network, true);
}
void ProxyConfigServiceImpl::OnUISetProxyConfig() {

Powered by Google App Engine
This is Rietveld 408576698