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