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

Side by Side Diff: chrome/browser/net/pref_proxy_config_tracker_impl.cc

Issue 10911099: Minor fixes in proxy configuration on iOS. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: indentation Created 8 years, 3 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 unified diff | Download patch
OLDNEW
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
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;
319 #else
320
321 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 317 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
322 318
323 // Clear the configuration and source. 319 // Clear the configuration and source.
324 *config = net::ProxyConfig(); 320 *config = net::ProxyConfig();
325 ProxyPrefs::ConfigState config_state = ProxyPrefs::CONFIG_UNSET; 321 ProxyPrefs::ConfigState config_state = ProxyPrefs::CONFIG_UNSET;
326 322
327 const PrefService::Preference* pref = 323 const PrefService::Preference* pref =
328 pref_service_->FindPreference(prefs::kProxy); 324 pref_service_->FindPreference(prefs::kProxy);
329 DCHECK(pref); 325 DCHECK(pref);
330 326
331 const DictionaryValue* dict = pref_service_->GetDictionary(prefs::kProxy); 327 const DictionaryValue* dict = pref_service_->GetDictionary(prefs::kProxy);
332 DCHECK(dict); 328 DCHECK(dict);
333 ProxyConfigDictionary proxy_dict(dict); 329 ProxyConfigDictionary proxy_dict(dict);
334 330
335 if (PrefConfigToNetConfig(proxy_dict, config)) { 331 if (PrefConfigToNetConfig(proxy_dict, config)) {
336 if (!pref->IsUserModifiable() || pref->HasUserSetting()) { 332 if (!pref->IsUserModifiable() || pref->HasUserSetting()) {
337 if (pref->IsManaged()) 333 if (pref->IsManaged())
338 config_state = ProxyPrefs::CONFIG_POLICY; 334 config_state = ProxyPrefs::CONFIG_POLICY;
339 else if (pref->IsExtensionControlled()) 335 else if (pref->IsExtensionControlled())
340 config_state = ProxyPrefs::CONFIG_EXTENSION; 336 config_state = ProxyPrefs::CONFIG_EXTENSION;
341 else 337 else
342 config_state = ProxyPrefs::CONFIG_OTHER_PRECEDE; 338 config_state = ProxyPrefs::CONFIG_OTHER_PRECEDE;
343 } else { 339 } else {
344 config_state = ProxyPrefs::CONFIG_FALLBACK; 340 config_state = ProxyPrefs::CONFIG_FALLBACK;
345 } 341 }
346 } 342 }
347 343
348 return config_state; 344 return config_state;
349 #endif // defined(OS_IOS)
350 } 345 }
OLDNEW
« no previous file with comments | « no previous file | net/proxy/proxy_config_service_ios.h » ('j') | net/proxy/proxy_config_service_ios.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698