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 #ifndef COMPONENTS_PROXY_CONFIG_PROXY_PREFS_H_ | 5 #ifndef COMPONENTS_PROXY_CONFIG_PROXY_PREFS_H_ |
6 #define COMPONENTS_PROXY_CONFIG_PROXY_PREFS_H_ | 6 #define COMPONENTS_PROXY_CONFIG_PROXY_PREFS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "components/proxy_config/proxy_config_export.h" | 10 #include "components/proxy_config/proxy_config_export.h" |
11 | 11 |
12 namespace ProxyPrefs { | 12 namespace ProxyPrefs { |
13 | 13 |
14 // Possible types of specifying proxy settings. Do not change the order of | 14 // Possible types of specifying proxy settings. Do not change the order of |
15 // the constants, because numeric values are exposed to users. | 15 // the constants, because numeric values are exposed to users. |
16 // If you add an enum constant, you should also add a string to | 16 // If you add an enum constant, you should also add a string to |
17 // kProxyModeNames in the .cc file. | 17 // kProxyModeNames in the .cc file. |
18 enum PROXY_CONFIG_EXPORT ProxyMode { | 18 enum ProxyMode { |
19 // Direct connection to the network, other proxy preferences are ignored. | 19 // Direct connection to the network, other proxy preferences are ignored. |
20 MODE_DIRECT = 0, | 20 MODE_DIRECT = 0, |
21 | 21 |
22 // Try to retrieve a PAC script from http://wpad/wpad.dat or fall back to | 22 // Try to retrieve a PAC script from http://wpad/wpad.dat or fall back to |
23 // direct connection. | 23 // direct connection. |
24 MODE_AUTO_DETECT = 1, | 24 MODE_AUTO_DETECT = 1, |
25 | 25 |
26 // Try to retrieve a PAC script from kProxyPacURL or fall back to direct | 26 // Try to retrieve a PAC script from kProxyPacURL or fall back to direct |
27 // connection. | 27 // connection. |
28 MODE_PAC_SCRIPT = 2, | 28 MODE_PAC_SCRIPT = 2, |
29 | 29 |
30 // Use the settings specified in kProxyServer and kProxyBypassList. | 30 // Use the settings specified in kProxyServer and kProxyBypassList. |
31 MODE_FIXED_SERVERS = 3, | 31 MODE_FIXED_SERVERS = 3, |
32 | 32 |
33 // The system's proxy settings are used, other proxy preferences are | 33 // The system's proxy settings are used, other proxy preferences are |
34 // ignored. | 34 // ignored. |
35 MODE_SYSTEM = 4, | 35 MODE_SYSTEM = 4, |
36 | 36 |
37 kModeCount | 37 kModeCount |
38 }; | 38 }; |
39 | 39 |
40 // State of proxy configuration. | 40 // State of proxy configuration. |
41 enum PROXY_CONFIG_EXPORT ConfigState { | 41 enum ConfigState { |
42 // Configuration is from policy. | 42 // Configuration is from policy. |
43 CONFIG_POLICY, | 43 CONFIG_POLICY, |
44 // Configuration is from extension. | 44 // Configuration is from extension. |
45 CONFIG_EXTENSION, | 45 CONFIG_EXTENSION, |
46 // Configuration is not from policy or extension but still precedes others. | 46 // Configuration is not from policy or extension but still precedes others. |
47 CONFIG_OTHER_PRECEDE, | 47 CONFIG_OTHER_PRECEDE, |
48 // Configuration is from system. | 48 // Configuration is from system. |
49 CONFIG_SYSTEM, | 49 CONFIG_SYSTEM, |
50 // Configuration is recommended i.e there's a fallback configuration. | 50 // Configuration is recommended i.e there's a fallback configuration. |
51 CONFIG_FALLBACK, | 51 CONFIG_FALLBACK, |
(...skipping 12 matching lines...) Expand all Loading... |
64 PROXY_CONFIG_EXPORT bool IntToProxyMode(int in_value, ProxyMode* out_value); | 64 PROXY_CONFIG_EXPORT bool IntToProxyMode(int in_value, ProxyMode* out_value); |
65 PROXY_CONFIG_EXPORT bool StringToProxyMode(const std::string& in_value, | 65 PROXY_CONFIG_EXPORT bool StringToProxyMode(const std::string& in_value, |
66 ProxyMode* out_value); | 66 ProxyMode* out_value); |
67 // Ownership of the return value is NOT passed to the caller. | 67 // Ownership of the return value is NOT passed to the caller. |
68 PROXY_CONFIG_EXPORT const char* ProxyModeToString(ProxyMode mode); | 68 PROXY_CONFIG_EXPORT const char* ProxyModeToString(ProxyMode mode); |
69 PROXY_CONFIG_EXPORT std::string ConfigStateToDebugString(ConfigState state); | 69 PROXY_CONFIG_EXPORT std::string ConfigStateToDebugString(ConfigState state); |
70 | 70 |
71 } // namespace ProxyPrefs | 71 } // namespace ProxyPrefs |
72 | 72 |
73 #endif // COMPONENTS_PROXY_CONFIG_PROXY_PREFS_H_ | 73 #endif // COMPONENTS_PROXY_CONFIG_PROXY_PREFS_H_ |
OLD | NEW |