| 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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 if (!proxy_proto.ParseFromString(input)) | 288 if (!proxy_proto.ParseFromString(input)) |
| 289 return false; | 289 return false; |
| 290 | 290 |
| 291 const std::string& mode_string(proxy_proto.proxy_mode()); | 291 const std::string& mode_string(proxy_proto.proxy_mode()); |
| 292 if (mode_string == ProxyPrefs::kDirectProxyModeName) { | 292 if (mode_string == ProxyPrefs::kDirectProxyModeName) { |
| 293 mode = MODE_DIRECT; | 293 mode = MODE_DIRECT; |
| 294 } else if (mode_string == ProxyPrefs::kAutoDetectProxyModeName) { | 294 } else if (mode_string == ProxyPrefs::kAutoDetectProxyModeName) { |
| 295 mode = MODE_AUTO_DETECT; | 295 mode = MODE_AUTO_DETECT; |
| 296 } else if (mode_string == ProxyPrefs::kPacScriptProxyModeName) { | 296 } else if (mode_string == ProxyPrefs::kPacScriptProxyModeName) { |
| 297 mode = MODE_PAC_SCRIPT; | 297 mode = MODE_PAC_SCRIPT; |
| 298 if (proxy_proto.has_proxy_pac_url()) | 298 if (proxy_proto.has_proxy_pac_url()) { |
| 299 automatic_proxy.pac_url = GURL(proxy_proto.proxy_pac_url()); | 299 GURL pac_url = GURL(proxy_proto.proxy_pac_url()); |
| 300 automatic_proxy.pac_url = pac_url.is_valid() ? pac_url : GURL(); |
| 301 } |
| 300 } else if (mode_string == ProxyPrefs::kFixedServersProxyModeName) { | 302 } else if (mode_string == ProxyPrefs::kFixedServersProxyModeName) { |
| 301 net::ProxyConfig::ProxyRules rules; | 303 net::ProxyConfig::ProxyRules rules; |
| 302 rules.ParseFromString(proxy_proto.proxy_server()); | 304 rules.ParseFromString(proxy_proto.proxy_server()); |
| 303 switch (rules.type) { | 305 switch (rules.type) { |
| 304 case net::ProxyConfig::ProxyRules::TYPE_NO_RULES: | 306 case net::ProxyConfig::ProxyRules::TYPE_NO_RULES: |
| 305 return false; | 307 return false; |
| 306 case net::ProxyConfig::ProxyRules::TYPE_SINGLE_PROXY: | 308 case net::ProxyConfig::ProxyRules::TYPE_SINGLE_PROXY: |
| 307 if (!rules.single_proxy.is_valid()) | 309 if (!rules.single_proxy.is_valid()) |
| 308 return false; | 310 return false; |
| 309 mode = MODE_SINGLE_PROXY; | 311 mode = MODE_SINGLE_PROXY; |
| (...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 840 device_config_.clear(); | 842 device_config_.clear(); |
| 841 return; | 843 return; |
| 842 } | 844 } |
| 843 if (!active_network_.empty()) { | 845 if (!active_network_.empty()) { |
| 844 VLOG(1) << this << ": try migrating device config to " << active_network_; | 846 VLOG(1) << this << ": try migrating device config to " << active_network_; |
| 845 SetProxyConfigForNetwork(active_network_, device_config_, true); | 847 SetProxyConfigForNetwork(active_network_, device_config_, true); |
| 846 } | 848 } |
| 847 } | 849 } |
| 848 | 850 |
| 849 } // namespace chromeos | 851 } // namespace chromeos |
| OLD | NEW |