OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CHROME_BROWSER_CHROMEOS_UI_PROXY_CONFIG_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_UI_PROXY_CONFIG_H_ |
6 #define CHROME_BROWSER_CHROMEOS_UI_PROXY_CONFIG_H_ | 6 #define CHROME_BROWSER_CHROMEOS_UI_PROXY_CONFIG_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "chrome/browser/prefs/proxy_prefs.h" | 10 #include "chrome/browser/prefs/proxy_prefs.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 const net::ProxyServer& server); | 66 const net::ProxyServer& server); |
67 | 67 |
68 // Only valid for MODE_SINGLE_PROXY or MODE_PROXY_PER_SCHEME. | 68 // Only valid for MODE_SINGLE_PROXY or MODE_PROXY_PER_SCHEME. |
69 void SetBypassRules(const net::ProxyBypassRules& rules); | 69 void SetBypassRules(const net::ProxyBypassRules& rules); |
70 | 70 |
71 // Converts net::ProxyConfig to |this|. | 71 // Converts net::ProxyConfig to |this|. |
72 bool FromNetProxyConfig(const net::ProxyConfig& net_config); | 72 bool FromNetProxyConfig(const net::ProxyConfig& net_config); |
73 | 73 |
74 // Converts |this| to Dictionary of ProxyConfigDictionary format (which | 74 // Converts |this| to Dictionary of ProxyConfigDictionary format (which |
75 // is the same format used by prefs). | 75 // is the same format used by prefs). |
76 base::DictionaryValue* ToPrefProxyConfig(); | 76 base::DictionaryValue* ToPrefProxyConfig() const; |
77 | 77 |
78 // Map |scheme| (one of "http", "https", "ftp" or "socks") to the correct | 78 // Map |scheme| (one of "http", "https", "ftp" or "socks") to the correct |
79 // ManualProxy. Returns NULL if scheme is invalid. | 79 // ManualProxy. Returns NULL if scheme is invalid. |
80 ManualProxy* MapSchemeToProxy(const std::string& scheme); | 80 ManualProxy* MapSchemeToProxy(const std::string& scheme); |
81 | 81 |
82 // Serializes config into a ProxyConfigDictionary and then std::string | |
83 // persisted as string property in shill for a network. | |
84 bool SerializeForNetwork(std::string* output); | |
85 | |
86 // Encodes the proxy server as "<url-scheme>=<proxy-scheme>://<proxy>" | 82 // Encodes the proxy server as "<url-scheme>=<proxy-scheme>://<proxy>" |
87 static void EncodeAndAppendProxyServer(const std::string& url_scheme, | 83 static void EncodeAndAppendProxyServer(const std::string& url_scheme, |
88 const net::ProxyServer& server, | 84 const net::ProxyServer& server, |
89 std::string* spec); | 85 std::string* spec); |
90 | 86 |
91 Mode mode; | 87 Mode mode; |
92 | 88 |
93 ProxyPrefs::ConfigState state; | 89 ProxyPrefs::ConfigState state; |
94 | 90 |
95 // True if user can modify proxy settings via UI. | 91 // True if user can modify proxy settings via UI. |
(...skipping 15 matching lines...) Expand all Loading... |
111 // Set if mode is MODE_PROXY_PER_SCHEME and has socks proxy. | 107 // Set if mode is MODE_PROXY_PER_SCHEME and has socks proxy. |
112 ManualProxy socks_proxy; | 108 ManualProxy socks_proxy; |
113 | 109 |
114 // Exceptions for when not to use a proxy. | 110 // Exceptions for when not to use a proxy. |
115 net::ProxyBypassRules bypass_rules; | 111 net::ProxyBypassRules bypass_rules; |
116 }; | 112 }; |
117 | 113 |
118 } // namespace chromeos | 114 } // namespace chromeos |
119 | 115 |
120 #endif // CHROME_BROWSER_CHROMEOS_UI_PROXY_CONFIG_H_ | 116 #endif // CHROME_BROWSER_CHROMEOS_UI_PROXY_CONFIG_H_ |
OLD | NEW |