OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #ifndef NET_PROXY_PROXY_INFO_H_ | 5 #ifndef NET_PROXY_PROXY_INFO_H_ |
6 #define NET_PROXY_PROXY_INFO_H_ | 6 #define NET_PROXY_PROXY_INFO_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "net/proxy/proxy_config.h" | 10 #include "net/proxy/proxy_config.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 } | 43 } |
44 | 44 |
45 // Returns true if this proxy info specifies a direct connection. | 45 // Returns true if this proxy info specifies a direct connection. |
46 bool is_direct() const { | 46 bool is_direct() const { |
47 // We don't implicitly fallback to DIRECT unless it was added to the list. | 47 // We don't implicitly fallback to DIRECT unless it was added to the list. |
48 if (is_empty()) | 48 if (is_empty()) |
49 return false; | 49 return false; |
50 return proxy_list_.Get().is_direct(); | 50 return proxy_list_.Get().is_direct(); |
51 } | 51 } |
52 | 52 |
53 // Returns true if the first valid proxy server is a http proxy. | 53 // Returns true if the first valid proxy server is an https proxy. |
| 54 bool is_https() const { |
| 55 if (is_empty()) |
| 56 return false; |
| 57 return proxy_server().is_https(); |
| 58 } |
| 59 |
| 60 // Returns true if the first valid proxy server is an http proxy. |
54 bool is_http() const { | 61 bool is_http() const { |
55 if (is_empty()) | 62 if (is_empty()) |
56 return false; | 63 return false; |
57 return proxy_server().is_http(); | 64 return proxy_server().is_http(); |
58 } | 65 } |
59 | 66 |
60 // Returns true if the first valid proxy server is a socks server. | 67 // Returns true if the first valid proxy server is a socks server. |
61 bool is_socks() const { | 68 bool is_socks() const { |
62 if (is_empty()) | 69 if (is_empty()) |
63 return false; | 70 return false; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 // try. If proxy_list_ is empty, then there is nothing left to fall back to. | 107 // try. If proxy_list_ is empty, then there is nothing left to fall back to. |
101 ProxyList proxy_list_; | 108 ProxyList proxy_list_; |
102 | 109 |
103 // This value identifies the proxy config used to initialize this object. | 110 // This value identifies the proxy config used to initialize this object. |
104 ProxyConfig::ID config_id_; | 111 ProxyConfig::ID config_id_; |
105 }; | 112 }; |
106 | 113 |
107 } // namespace net | 114 } // namespace net |
108 | 115 |
109 #endif // NET_PROXY_PROXY_INFO_H_ | 116 #endif // NET_PROXY_PROXY_INFO_H_ |
OLD | NEW |