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

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: Merge to head for commit Created 8 years, 1 month 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 3b20231712fe1a377185a7c3d02e2ca269ba2aca..5eca442c92bfd7292cfaf0431d25177009de0242 100644
--- a/chrome/browser/chromeos/proxy_config_service_impl.cc
+++ b/chrome/browser/chromeos/proxy_config_service_impl.cc
@@ -586,29 +586,26 @@ 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);
+void ProxyConfigServiceImpl::OnPreferenceChanged(PrefServiceBase* service,
+ const std::string& pref_name) {
+ DCHECK(service == prefs());
+ VLOG(1) << "New use-shared-proxies = " << GetUseSharedProxies();
+
+ if (pref_name == prefs::kUseSharedProxies) {
+ // 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;
}
- PrefProxyConfigTrackerImpl::Observe(type, source, details);
+
+ PrefProxyConfigTrackerImpl::OnPreferenceChanged(service, pref_name);
}
void ProxyConfigServiceImpl::OnUISetProxyConfig() {
« no previous file with comments | « chrome/browser/chromeos/proxy_config_service_impl.h ('k') | chrome/browser/chromeos/system/ash_system_tray_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698