| 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 "net/proxy/proxy_resolver_mac.h" | 5 #include "net/proxy/proxy_resolver_mac.h" |
| 6 | 6 |
| 7 #include <CoreFoundation/CoreFoundation.h> | 7 #include <CoreFoundation/CoreFoundation.h> |
| 8 #include <CoreServices/CoreServices.h> | |
| 9 | 8 |
| 10 #include "base/logging.h" | 9 #include "base/logging.h" |
| 11 #include "base/mac/foundation_util.h" | 10 #include "base/mac/foundation_util.h" |
| 12 #include "base/mac/scoped_cftyperef.h" | 11 #include "base/mac/scoped_cftyperef.h" |
| 13 #include "base/string_util.h" | 12 #include "base/string_util.h" |
| 14 #include "base/sys_string_conversions.h" | 13 #include "base/sys_string_conversions.h" |
| 15 #include "net/base/net_errors.h" | 14 #include "net/base/net_errors.h" |
| 16 #include "net/proxy/proxy_info.h" | 15 #include "net/proxy/proxy_info.h" |
| 17 #include "net/proxy/proxy_server.h" | 16 #include "net/proxy/proxy_server.h" |
| 18 | 17 |
| 18 #if defined(OS_IOS) |
| 19 #include <CFNetwork/CFProxySupport.h> |
| 20 #else |
| 21 #include <CoreServices/CoreServices.h> |
| 22 #endif |
| 23 |
| 19 namespace { | 24 namespace { |
| 20 | 25 |
| 21 // Utility function to map a CFProxyType to a ProxyServer::Scheme. | 26 // Utility function to map a CFProxyType to a ProxyServer::Scheme. |
| 22 // If the type is unknown, returns ProxyServer::SCHEME_INVALID. | 27 // If the type is unknown, returns ProxyServer::SCHEME_INVALID. |
| 23 net::ProxyServer::Scheme GetProxyServerScheme(CFStringRef proxy_type) { | 28 net::ProxyServer::Scheme GetProxyServerScheme(CFStringRef proxy_type) { |
| 24 if (CFEqual(proxy_type, kCFProxyTypeNone)) | 29 if (CFEqual(proxy_type, kCFProxyTypeNone)) |
| 25 return net::ProxyServer::SCHEME_DIRECT; | 30 return net::ProxyServer::SCHEME_DIRECT; |
| 26 if (CFEqual(proxy_type, kCFProxyTypeHTTP)) | 31 if (CFEqual(proxy_type, kCFProxyTypeHTTP)) |
| 27 return net::ProxyServer::SCHEME_HTTP; | 32 return net::ProxyServer::SCHEME_HTTP; |
| 28 if (CFEqual(proxy_type, kCFProxyTypeHTTPS)) { | 33 if (CFEqual(proxy_type, kCFProxyTypeHTTPS)) { |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 } | 206 } |
| 202 | 207 |
| 203 int ProxyResolverMac::SetPacScript( | 208 int ProxyResolverMac::SetPacScript( |
| 204 const scoped_refptr<ProxyResolverScriptData>& script_data, | 209 const scoped_refptr<ProxyResolverScriptData>& script_data, |
| 205 const CompletionCallback& /*callback*/) { | 210 const CompletionCallback& /*callback*/) { |
| 206 script_data_ = script_data; | 211 script_data_ = script_data; |
| 207 return OK; | 212 return OK; |
| 208 } | 213 } |
| 209 | 214 |
| 210 } // namespace net | 215 } // namespace net |
| OLD | NEW |