Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/net/pref_proxy_config_tracker_impl.h" | 5 #include "chrome/browser/net/pref_proxy_config_tracker_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "chrome/browser/prefs/pref_service.h" | 9 #include "chrome/browser/prefs/pref_service.h" |
| 10 #include "chrome/browser/prefs/pref_set_observer.h" | 10 #include "chrome/browser/prefs/pref_set_observer.h" |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 307 } | 307 } |
| 308 if (update_pending_) | 308 if (update_pending_) |
| 309 OnProxyConfigChanged(config_state, new_config); | 309 OnProxyConfigChanged(config_state, new_config); |
| 310 } else { | 310 } else { |
| 311 NOTREACHED() << "Unexpected notification of type " << type; | 311 NOTREACHED() << "Unexpected notification of type " << type; |
| 312 } | 312 } |
| 313 } | 313 } |
| 314 | 314 |
| 315 ProxyPrefs::ConfigState PrefProxyConfigTrackerImpl::ReadPrefConfig( | 315 ProxyPrefs::ConfigState PrefProxyConfigTrackerImpl::ReadPrefConfig( |
| 316 net::ProxyConfig* config) { | 316 net::ProxyConfig* config) { |
| 317 #if defined(OS_IOS) | |
| 318 return ProxyPrefs::CONFIG_UNSET; | |
|
wtc
2012/08/30 18:52:01
I suggest putting the rest of this function inside
eroman
2012/08/31 20:02:43
Why is this necessary?
| |
| 319 #endif | |
| 320 | |
| 317 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 321 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 318 | 322 |
| 319 // Clear the configuration and source. | 323 // Clear the configuration and source. |
| 320 *config = net::ProxyConfig(); | 324 *config = net::ProxyConfig(); |
| 321 ProxyPrefs::ConfigState config_state = ProxyPrefs::CONFIG_UNSET; | 325 ProxyPrefs::ConfigState config_state = ProxyPrefs::CONFIG_UNSET; |
| 322 | 326 |
| 323 const PrefService::Preference* pref = | 327 const PrefService::Preference* pref = |
| 324 pref_service_->FindPreference(prefs::kProxy); | 328 pref_service_->FindPreference(prefs::kProxy); |
| 325 DCHECK(pref); | 329 DCHECK(pref); |
| 326 | 330 |
| 327 const DictionaryValue* dict = pref_service_->GetDictionary(prefs::kProxy); | 331 const DictionaryValue* dict = pref_service_->GetDictionary(prefs::kProxy); |
| 328 DCHECK(dict); | 332 DCHECK(dict); |
| 329 ProxyConfigDictionary proxy_dict(dict); | 333 ProxyConfigDictionary proxy_dict(dict); |
| 330 | 334 |
| 331 if (PrefConfigToNetConfig(proxy_dict, config)) { | 335 if (PrefConfigToNetConfig(proxy_dict, config)) { |
| 332 if (!pref->IsUserModifiable() || pref->HasUserSetting()) { | 336 if (!pref->IsUserModifiable() || pref->HasUserSetting()) { |
| 333 if (pref->IsManaged()) | 337 if (pref->IsManaged()) |
| 334 config_state = ProxyPrefs::CONFIG_POLICY; | 338 config_state = ProxyPrefs::CONFIG_POLICY; |
| 335 else if (pref->IsExtensionControlled()) | 339 else if (pref->IsExtensionControlled()) |
| 336 config_state = ProxyPrefs::CONFIG_EXTENSION; | 340 config_state = ProxyPrefs::CONFIG_EXTENSION; |
| 337 else | 341 else |
| 338 config_state = ProxyPrefs::CONFIG_OTHER_PRECEDE; | 342 config_state = ProxyPrefs::CONFIG_OTHER_PRECEDE; |
| 339 } else { | 343 } else { |
| 340 config_state = ProxyPrefs::CONFIG_FALLBACK; | 344 config_state = ProxyPrefs::CONFIG_FALLBACK; |
| 341 } | 345 } |
| 342 } | 346 } |
| 343 | 347 |
| 344 return config_state; | 348 return config_state; |
| 345 } | 349 } |
| OLD | NEW |