| 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 "net/proxy/proxy_config_service_ios.h" | 5 #include "net/proxy/proxy_config_service_ios.h" |
| 6 | 6 |
| 7 #include <CoreFoundation/CoreFoundation.h> | 7 #include <CoreFoundation/CoreFoundation.h> |
| 8 #include <CFNetwork/CFProxySupport.h> | 8 #include <CFNetwork/CFProxySupport.h> |
| 9 | 9 |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 kCFNetworkProxiesHTTPEnable, | 71 kCFNetworkProxiesHTTPEnable, |
| 72 false)) { | 72 false)) { |
| 73 ProxyServer proxy_server = | 73 ProxyServer proxy_server = |
| 74 ProxyServer::FromDictionary(ProxyServer::SCHEME_HTTP, | 74 ProxyServer::FromDictionary(ProxyServer::SCHEME_HTTP, |
| 75 config_dict.get(), | 75 config_dict.get(), |
| 76 kCFNetworkProxiesHTTPProxy, | 76 kCFNetworkProxiesHTTPProxy, |
| 77 kCFNetworkProxiesHTTPPort); | 77 kCFNetworkProxiesHTTPPort); |
| 78 if (proxy_server.is_valid()) { | 78 if (proxy_server.is_valid()) { |
| 79 config->proxy_rules().type = | 79 config->proxy_rules().type = |
| 80 ProxyConfig::ProxyRules::TYPE_PROXY_PER_SCHEME; | 80 ProxyConfig::ProxyRules::TYPE_PROXY_PER_SCHEME; |
| 81 config->proxy_rules().proxy_for_http = proxy_server; | 81 config->proxy_rules().proxy_for_http.SetSingleProxyServer(proxy_server); |
| 82 // Desktop Safari applies the HTTP proxy to http:// URLs only, but | 82 // Desktop Safari applies the HTTP proxy to http:// URLs only, but |
| 83 // Mobile Safari applies the HTTP proxy to https:// URLs as well. | 83 // Mobile Safari applies the HTTP proxy to https:// URLs as well. |
| 84 config->proxy_rules().proxy_for_https = proxy_server; | 84 config->proxy_rules().proxy_for_https.SetSingleProxyServer(proxy_server); |
| 85 } | 85 } |
| 86 } | 86 } |
| 87 | 87 |
| 88 // Proxy bypass list is not supported. | 88 // Proxy bypass list is not supported. |
| 89 // The kCFNetworkProxiesExceptionsList key is not available on iOS. | 89 // The kCFNetworkProxiesExceptionsList key is not available on iOS. |
| 90 | 90 |
| 91 // Proxy bypass boolean is not supported. | 91 // Proxy bypass boolean is not supported. |
| 92 // The kCFNetworkProxiesExcludeSimpleHostnames key is not available on iOS. | 92 // The kCFNetworkProxiesExcludeSimpleHostnames key is not available on iOS. |
| 93 | 93 |
| 94 // Source | 94 // Source |
| 95 config->set_source(PROXY_CONFIG_SOURCE_SYSTEM); | 95 config->set_source(PROXY_CONFIG_SOURCE_SYSTEM); |
| 96 } | 96 } |
| 97 | 97 |
| 98 } // namespace | 98 } // namespace |
| 99 | 99 |
| 100 ProxyConfigServiceIOS::ProxyConfigServiceIOS() | 100 ProxyConfigServiceIOS::ProxyConfigServiceIOS() |
| 101 : PollingProxyConfigService(base::TimeDelta::FromSeconds(kPollIntervalSec), | 101 : PollingProxyConfigService(base::TimeDelta::FromSeconds(kPollIntervalSec), |
| 102 GetCurrentProxyConfig) { | 102 GetCurrentProxyConfig) { |
| 103 } | 103 } |
| 104 | 104 |
| 105 ProxyConfigServiceIOS::~ProxyConfigServiceIOS() { | 105 ProxyConfigServiceIOS::~ProxyConfigServiceIOS() { |
| 106 } | 106 } |
| 107 | 107 |
| 108 } // namespace net | 108 } // namespace net |
| OLD | NEW |