| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chromeos/proxy_config_service_impl.h" | 5 #include "chrome/browser/chromeos/proxy_config_service_impl.h" |
| 6 | 6 |
| 7 #include <ostream> | 7 #include <ostream> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/json/json_string_value_serializer.h" | 10 #include "base/json/json_string_value_serializer.h" |
| (...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 } | 356 } |
| 357 } | 357 } |
| 358 JSONStringValueSerializer serializer(output); | 358 JSONStringValueSerializer serializer(output); |
| 359 return serializer.Serialize(*dict); | 359 return serializer.Serialize(*dict); |
| 360 } | 360 } |
| 361 | 361 |
| 362 //----------- ProxyConfigServiceImpl::ProxyConfig: private methods ------------- | 362 //----------- ProxyConfigServiceImpl::ProxyConfig: private methods ------------- |
| 363 | 363 |
| 364 // static | 364 // static |
| 365 void ProxyConfigServiceImpl::ProxyConfig::EncodeAndAppendProxyServer( | 365 void ProxyConfigServiceImpl::ProxyConfig::EncodeAndAppendProxyServer( |
| 366 const std::string& scheme, | 366 const std::string& url_scheme, |
| 367 const net::ProxyServer& server, | 367 const net::ProxyServer& server, |
| 368 std::string* spec) { | 368 std::string* spec) { |
| 369 if (!server.is_valid()) | 369 if (!server.is_valid()) |
| 370 return; | 370 return; |
| 371 | 371 |
| 372 if (!spec->empty()) | 372 if (!spec->empty()) |
| 373 *spec += ';'; | 373 *spec += ';'; |
| 374 | 374 |
| 375 if (!scheme.empty()) { | 375 if (!url_scheme.empty()) { |
| 376 *spec += scheme; | 376 *spec += url_scheme; |
| 377 *spec += "="; | 377 *spec += "="; |
| 378 } | 378 } |
| 379 *spec += server.ToURI(); | 379 *spec += server.ToURI(); |
| 380 } | 380 } |
| 381 | 381 |
| 382 //------------------- ProxyConfigServiceImpl: public methods ------------------- | 382 //------------------- ProxyConfigServiceImpl: public methods ------------------- |
| 383 | 383 |
| 384 ProxyConfigServiceImpl::ProxyConfigServiceImpl(PrefService* pref_service) | 384 ProxyConfigServiceImpl::ProxyConfigServiceImpl(PrefService* pref_service) |
| 385 : PrefProxyConfigTrackerImpl(pref_service), | 385 : PrefProxyConfigTrackerImpl(pref_service), |
| 386 active_config_state_(ProxyPrefs::CONFIG_UNSET), | 386 active_config_state_(ProxyPrefs::CONFIG_UNSET), |
| (...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 840 device_config_.clear(); | 840 device_config_.clear(); |
| 841 return; | 841 return; |
| 842 } | 842 } |
| 843 if (!active_network_.empty()) { | 843 if (!active_network_.empty()) { |
| 844 VLOG(1) << "Try migrating device config to " << active_network_; | 844 VLOG(1) << "Try migrating device config to " << active_network_; |
| 845 SetProxyConfigForNetwork(active_network_, device_config_, true); | 845 SetProxyConfigForNetwork(active_network_, device_config_, true); |
| 846 } | 846 } |
| 847 } | 847 } |
| 848 | 848 |
| 849 } // namespace chromeos | 849 } // namespace chromeos |
| OLD | NEW |