| 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 CHROMEOS_NETWORK_PROXY_UI_PROXY_CONFIG_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_UI_PROXY_CONFIG_H_ | 6 #define CHROMEOS_NETWORK_PROXY_UI_PROXY_CONFIG_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "chromeos/chromeos_export.h" |
| 10 #include "components/proxy_config/proxy_prefs.h" | 11 #include "components/proxy_config/proxy_prefs.h" |
| 11 #include "net/proxy/proxy_bypass_rules.h" | 12 #include "net/proxy/proxy_bypass_rules.h" |
| 12 #include "net/proxy/proxy_server.h" | 13 #include "net/proxy/proxy_server.h" |
| 13 #include "url/gurl.h" | 14 #include "url/gurl.h" |
| 14 | 15 |
| 15 namespace base { | 16 namespace base { |
| 16 class DictionaryValue; | 17 class DictionaryValue; |
| 17 } | 18 } |
| 18 | 19 |
| 19 namespace net { | 20 namespace net { |
| 20 class ProxyConfig; | 21 class ProxyConfig; |
| 21 } | 22 } |
| 22 | 23 |
| 23 namespace chromeos { | 24 namespace chromeos { |
| 24 | 25 |
| 25 // Contrary to other platforms which simply use the systems' UI to allow users | 26 // Contrary to other platforms which simply use the systems' UI to allow users |
| 26 // to configure proxies, we have to implement our own UI on the chromeos device. | 27 // to configure proxies, we have to implement our own UI on the chromeos device. |
| 27 // This requires extra and specific UI requirements that net::ProxyConfig does | 28 // This requires extra and specific UI requirements that net::ProxyConfig does |
| 28 // not supply. So we create an augmented analog to net::ProxyConfig here to | 29 // not supply. So we create an augmented analog to net::ProxyConfig here to |
| 29 // include and handle these UI requirements, e.g. | 30 // include and handle these UI requirements, e.g. |
| 30 // - state of configuration e.g. where it was picked up from - policy, | 31 // - state of configuration e.g. where it was picked up from - policy, |
| 31 // extension, etc (refer to ProxyPrefs::ConfigState) | 32 // extension, etc (refer to ProxyPrefs::ConfigState) |
| 32 // - the read/write access of a proxy setting | 33 // - the read/write access of a proxy setting |
| 33 // - may add more stuff later. | 34 // - may add more stuff later. |
| 34 // This is then converted to the common net::ProxyConfig before being pushed | 35 // This is then converted to the common net::ProxyConfig before being pushed |
| 35 // to PrefProxyConfigTrackerImpl::OnProxyConfigChanged and then to the network | 36 // to PrefProxyConfigTrackerImpl::OnProxyConfigChanged and then to the network |
| 36 // stack. | 37 // stack. |
| 37 struct UIProxyConfig { | 38 struct CHROMEOS_EXPORT UIProxyConfig { |
| 38 // Specifies if proxy config is direct, auto-detect, using pac script, | 39 // Specifies if proxy config is direct, auto-detect, using pac script, |
| 39 // single-proxy, or proxy-per-scheme. | 40 // single-proxy, or proxy-per-scheme. |
| 40 enum Mode { | 41 enum Mode { |
| 41 MODE_DIRECT, | 42 MODE_DIRECT, |
| 42 MODE_AUTO_DETECT, | 43 MODE_AUTO_DETECT, |
| 43 MODE_PAC_SCRIPT, | 44 MODE_PAC_SCRIPT, |
| 44 MODE_SINGLE_PROXY, | 45 MODE_SINGLE_PROXY, |
| 45 MODE_PROXY_PER_SCHEME, | 46 MODE_PROXY_PER_SCHEME, |
| 46 }; | 47 }; |
| 47 | 48 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 | 84 |
| 84 ProxyPrefs::ConfigState state; | 85 ProxyPrefs::ConfigState state; |
| 85 | 86 |
| 86 // True if user can modify proxy settings via UI. | 87 // True if user can modify proxy settings via UI. |
| 87 // If proxy is managed by policy or extension or other_precde or is for | 88 // If proxy is managed by policy or extension or other_precde or is for |
| 88 // shared network but kUseSharedProxies is turned off, it can't be modified | 89 // shared network but kUseSharedProxies is turned off, it can't be modified |
| 89 // by user. | 90 // by user. |
| 90 bool user_modifiable; | 91 bool user_modifiable; |
| 91 | 92 |
| 92 // Set if mode is MODE_DIRECT or MODE_AUTO_DETECT or MODE_PAC_SCRIPT. | 93 // Set if mode is MODE_DIRECT or MODE_AUTO_DETECT or MODE_PAC_SCRIPT. |
| 93 AutomaticProxy automatic_proxy; | 94 AutomaticProxy automatic_proxy; |
| 94 // Set if mode is MODE_SINGLE_PROXY. | 95 // Set if mode is MODE_SINGLE_PROXY. |
| 95 ManualProxy single_proxy; | 96 ManualProxy single_proxy; |
| 96 // Set if mode is MODE_PROXY_PER_SCHEME and has http proxy. | 97 // Set if mode is MODE_PROXY_PER_SCHEME and has http proxy. |
| 97 ManualProxy http_proxy; | 98 ManualProxy http_proxy; |
| 98 // Set if mode is MODE_PROXY_PER_SCHEME and has https proxy. | 99 // Set if mode is MODE_PROXY_PER_SCHEME and has https proxy. |
| 99 ManualProxy https_proxy; | 100 ManualProxy https_proxy; |
| 100 // Set if mode is MODE_PROXY_PER_SCHEME and has ftp proxy. | 101 // Set if mode is MODE_PROXY_PER_SCHEME and has ftp proxy. |
| 101 ManualProxy ftp_proxy; | 102 ManualProxy ftp_proxy; |
| 102 // Set if mode is MODE_PROXY_PER_SCHEME and has socks proxy. | 103 // Set if mode is MODE_PROXY_PER_SCHEME and has socks proxy. |
| 103 ManualProxy socks_proxy; | 104 ManualProxy socks_proxy; |
| 104 | 105 |
| 105 // Exceptions for when not to use a proxy. | 106 // Exceptions for when not to use a proxy. |
| 106 net::ProxyBypassRules bypass_rules; | 107 net::ProxyBypassRules bypass_rules; |
| 107 }; | 108 }; |
| 108 | 109 |
| 109 } // namespace chromeos | 110 } // namespace chromeos |
| 110 | 111 |
| 111 #endif // CHROME_BROWSER_CHROMEOS_UI_PROXY_CONFIG_H_ | 112 #endif // CHROMEOS_NETWORK_PROXY_UI_PROXY_CONFIG_H_ |
| OLD | NEW |